Repository navigation
[No QA] MenuItem decomposition - usages with avatars #98862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
roryabraham
merged 44 commits into
Expensify:main
from
software-mansion-labs:war-in/menu-item-decomposition-entity
Sep 1, 2026
Merged
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
1496e71
feat: add primitives to support menu item with avatars
war-in ff567b6
feat: add MenuItemEntity
war-in a966434
refactor: migrate avatar-related callsites
war-in 053be2e
refactor: extract variant styles for description
war-in 29de266
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 37561ce
feat: add testID to root and presets
war-in 61809ab
chore: MenuItemComparison.stories.tsx update
war-in f404831
fix: move description variants to MenuItemDescription
war-in d2df096
fix: improve spacing and correctness
war-in e1333cc
fix: pass `accessibilityLabel` to skip rerenders
war-in e37b6f3
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 0dd9b7c
feat: add MenuItemField
war-in bb62688
fix: remove unnecessary `MenuItemDescriptionVariantStyles`
war-in 03b670e
fix: don't filter when both exist
war-in 81218ae
fix: move onyx data to loaders
war-in be33b2b
fix: remove unnecessary FallbackAvatar
war-in 11f72ab
fix: add default avatar handling
war-in 61435d6
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 1e9bc87
chore: rename to John Doe
war-in ef7c027
refactor: add `MenuItemWithLabel` preset
war-in 6cbc13b
fix: follow disabled state in label
war-in 2ba065e
chore: update gallery
war-in a89fc9c
fix: pass accessibilityLabel down to Root
war-in a8ab873
fix: update comments
war-in 415a73b
refactor: remove MenuItemField.tsx and migrate callsites
war-in 4dd6f65
fix: dont show chevron when field already set
war-in 7192da4
fix: accept optional onPress
war-in 1809170
fix: guard on displayNamesWithTooltips length too
war-in f369507
refactor: move `RevokeRow` to separate file
war-in 8c4bce3
refactor: rename MenuItemEntity to MenuItemAvatarNavigation
war-in 8579e56
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in dfda66b
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 6e6d352
fix: revert margin bottom removal
war-in a1b3156
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 1c5501e
fix: render a fallbackAvatar when no source passed
war-in 4241c5b
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in af9163c
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 8917e51
fix: ConfirmDelegatePageTest
war-in f10dbce
fix: ConfirmDelegatePageTest
war-in fc08e5b
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 3d16db5
fix: split description into default and placeholder version
war-in 0066307
fix: remove optional `onPress` from MenuItemEmptyField
war-in 9665e3a
Merge branch 'main' into war-in/menu-item-decomposition-entity
war-in 4482a44
tests: update VacationDelegateMenuItemTest
war-in File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import type {PropsWithChildren} from 'react'; | ||
|
|
||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
|
|
||
| type MenuItemLeadingProps = PropsWithChildren; | ||
|
|
||
| /** The leading cell of a `MenuItem.Row`. Sets no width of its own — it centers and sizes to its content */ | ||
| function MenuItemLeading({children}: MenuItemLeadingProps) { | ||
| const styles = useThemeStyles(); | ||
|
|
||
| return <View style={styles.menuItemLeading}>{children}</View>; | ||
| } | ||
|
|
||
| export default MenuItemLeading; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/components/MenuItem/leaves/text/description/MenuItemDescriptionPlaceholder.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import {useMenuItemAccessibilityLabel} from '@components/MenuItem/MenuItemAccessibilityContext'; | ||
| import Text from '@components/Text'; | ||
|
|
||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import variables from '@styles/variables'; | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| import type MenuItemDescriptionProps from './types'; | ||
|
|
||
| /** The normal-size description of a `MenuItem.Content`, for a description-only row */ | ||
| function MenuItemDescriptionPlaceholder({children, numberOfLines = 2}: MenuItemDescriptionProps) { | ||
| const styles = useThemeStyles(); | ||
| const StyleUtils = useStyleUtils(); | ||
|
|
||
| useMenuItemAccessibilityLabel('description', String(children)); | ||
|
|
||
| return ( | ||
| <Text | ||
| style={[styles.textLabelSupporting, StyleUtils.getFontSizeStyle(variables.fontSizeNormal), StyleUtils.getLineHeightStyle(variables.fontSizeNormalHeight), styles.breakWord]} | ||
| numberOfLines={numberOfLines} | ||
| > | ||
| {children} | ||
| </Text> | ||
| ); | ||
| } | ||
|
|
||
| export default MenuItemDescriptionPlaceholder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| /** Props shared by every description leaf of a `MenuItem.Content` */ | ||
| type MenuItemDescriptionProps = { | ||
| /** Text to render as the description */ | ||
| children: string | number; | ||
|
|
||
| /** Maximum number of lines to render before the text is truncated */ | ||
| numberOfLines?: number; | ||
| }; | ||
|
|
||
| export default MenuItemDescriptionProps; |
19 changes: 19 additions & 0 deletions
19
src/components/MenuItem/leaves/trailing/MenuItemRightLabel.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import Text from '@components/Text'; | ||
|
|
||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| type MenuItemRightLabelProps = { | ||
| /** Text to render as the label */ | ||
| children: string; | ||
| }; | ||
|
|
||
| /** A short trailing hint of a `MenuItem.Row`, such as a `Required` marker */ | ||
| function MenuItemRightLabel({children}: MenuItemRightLabelProps) { | ||
| const styles = useThemeStyles(); | ||
|
|
||
| return <Text style={styles.rightLabelMenuItem}>{children}</Text>; | ||
| } | ||
|
|
||
| export default MenuItemRightLabel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.