Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b8bfde2
feat: add `MenuItemSectionRow` preset and migrate section rows
war-in Sep 8, 2026
64863dc
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 18, 2026
5935732
refactor: migrate to MenuItemSectionRow
war-in Sep 21, 2026
19fbbb4
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 21, 2026
190c193
refactor: migrate to MenuItemSectionRow component
war-in Sep 21, 2026
8a681dd
test: update mock
war-in Sep 21, 2026
c9a5af7
refactor: migrate SamlConfigurationDetailsSectionContent to MenuItem …
war-in Sep 22, 2026
58606fd
fix: lint
war-in Sep 22, 2026
93ac719
refactor: migrate to MenuItemSectionRow
war-in Sep 22, 2026
61a4075
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 22, 2026
3ad68e6
refactor: use `MenuItemField.Row`
war-in Sep 22, 2026
72d5650
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 23, 2026
3bd30f5
fix: remove unused MenuItemSectionRowProps export and apply Oxfmt
war-in Sep 23, 2026
64a78b2
chore: add comparison
war-in Sep 23, 2026
7f01c57
chore: improve comment
war-in Sep 23, 2026
52a6d93
fix: improve function names
war-in Sep 23, 2026
78f238e
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 24, 2026
cf9870a
refactor: migrate QBO & Xero to composable MenuItem
war-in Sep 24, 2026
7f3f9ca
refactor: migrate workflow approver to composable MenuItem
war-in Sep 24, 2026
7eac018
Merge branch 'main' into war-in/menuitem-decomposition-section
war-in Sep 25, 2026
e2fe61f
refactor: rename MenuItemSectionRow.tsx to MenuItemSectionRoot.tsx
war-in Sep 25, 2026
b02d828
test: fix after migration
war-in Sep 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/components/ImportOnyxState/BaseImportOnyxState.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import AttachmentPicker from '@components/AttachmentPicker';
import DecisionModal from '@components/DecisionModal';
import MenuItem from '@components/MenuItem';
import MenuItemSectionRoot from '@components/MenuItem/presets/MenuItemSectionRoot';

import {useMemoizedLazyExpensifyIcons} from '@hooks/useLazyAsset';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';

import type {FileObject} from '@src/types/utils/Attachment';

Expand All @@ -22,7 +22,6 @@ function BaseImportOnyxState({
}) {
const icons = useMemoizedLazyExpensifyIcons(['Upload']);
const {translate} = useLocalize();
const styles = useThemeStyles();

// We need to use isSmallScreenWidth instead of shouldUseNarrowLayout to apply the correct modal type for the decision modal
// eslint-disable-next-line rulesdir/prefer-shouldUseNarrowLayout-instead-of-isSmallScreenWidth
Expand All @@ -37,16 +36,20 @@ function BaseImportOnyxState({
>
{({openPicker}) => {
return (
<MenuItem
icon={icons.Upload}
title={translate('initialSettingsPage.troubleshoot.importOnyxState')}
wrapperStyle={[styles.sectionMenuItemTopDescription]}
<MenuItemSectionRoot
onPress={() => {
openPicker({
onPicked: (data) => onFileRead(data.at(0) ?? {}),
});
}}
/>
>
<MenuItem.Row>
<MenuItem.Icon src={icons.Upload} />
<MenuItem.Content>
<MenuItem.Title>{translate('initialSettingsPage.troubleshoot.importOnyxState')}</MenuItem.Title>
</MenuItem.Content>
</MenuItem.Row>
</MenuItemSectionRoot>
);
}}
</AttachmentPicker>
Expand Down
40 changes: 40 additions & 0 deletions src/components/MenuItem/presets/MenuItemSectionRoot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import MenuItemRoot from '@components/MenuItem/layout/MenuItemRoot';
import type {MenuItemRootProps} from '@components/MenuItem/layout/MenuItemRoot';

import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';

import type {RefObject} from 'react';

import React from 'react';
import {View} from 'react-native';

type MenuItemSectionRootProps = MenuItemRootProps & {
/** Ref to the bleed wrapper. Use it when a popover needs to anchor on the row. */
ref?: RefObject<View | null>;
};

/** A `MenuItem.Root` that spans the full width of a `Section`, ignoring the section's own horizontal padding */
function MenuItemSectionRoot({children, onPress, isDisabled = false, sentryLabel, testID, accessibilityLabel, ref}: MenuItemSectionRootProps) {
const styles = useThemeStyles();
const {shouldUseNarrowLayout} = useResponsiveLayout();

return (
<View
ref={ref}
style={shouldUseNarrowLayout ? styles.mhn5 : styles.mhn8}
>
<MenuItemRoot
onPress={onPress}
Comment thread
war-in marked this conversation as resolved.
Resolved
isDisabled={isDisabled}
sentryLabel={sentryLabel}
testID={testID}
accessibilityLabel={accessibilityLabel}
>
<View style={!shouldUseNarrowLayout && styles.ph3}>{children}</View>
</MenuItemRoot>
</View>
);
}

export default MenuItemSectionRoot;
38 changes: 18 additions & 20 deletions src/pages/ReimbursementAccount/NonUSD/Finish/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import MenuItem from '@components/MenuItem';
import MenuItemNavigation from '@components/MenuItem/presets/MenuItemNavigation';
import MenuItemSectionRoot from '@components/MenuItem/presets/MenuItemSectionRoot';
import ScreenWrapper from '@components/ScreenWrapper';
import ScrollView from '@components/ScrollView';
import Section from '@components/Section';
Expand All @@ -16,7 +17,6 @@ import useTwoFactorAuthRoute from '@hooks/useTwoFactorAuthRoute';
import Navigation from '@navigation/Navigation';

import {navigateToConciergeChat} from '@userActions/Report';
import {callFunctionIfActionIsAllowed} from '@userActions/Session';

import ONYXKEYS from '@src/ONYXKEYS';

Expand Down Expand Up @@ -78,25 +78,23 @@ function Finish() {
<View style={styles.mb6}>
<Text style={[styles.mt3, styles.textLabelSupportingEmptyValue]}>{translate('finishStep.weTake')}</Text>
</View>
<View style={styles.mhn5}>
<MenuItem.Root
onPress={callFunctionIfActionIsAllowed(() => {
Navigation.navigate(getTwoFactorAuthRoute());
})}
>
<MenuItem.Row>
<MenuItem.Leading>
<MenuItem.Icon src={icons.Shield} />
</MenuItem.Leading>
<MenuItem.Content>
<MenuItem.Title>{translate('finishStep.secure')}</MenuItem.Title>
</MenuItem.Content>
<MenuItem.Trailing>
<MenuItem.Chevron />
</MenuItem.Trailing>
</MenuItem.Row>
</MenuItem.Root>
</View>
<MenuItemSectionRoot
onPress={() => {
Navigation.navigate(getTwoFactorAuthRoute());
}}
>
<MenuItem.Row>
<MenuItem.Leading>
<MenuItem.Icon src={icons.Shield} />
</MenuItem.Leading>
<MenuItem.Content>
<MenuItem.Title>{translate('finishStep.secure')}</MenuItem.Title>
</MenuItem.Content>
<MenuItem.Trailing>
<MenuItem.Chevron />
</MenuItem.Trailing>
</MenuItem.Row>
</MenuItemSectionRoot>
</Section>
</ScrollView>
</ScreenWrapper>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {loadIllustration} from '@components/Icon/IllustrationLoader';
import type {IllustrationName} from '@components/Icon/IllustrationLoader';
import MenuItem from '@components/MenuItem';
import MenuItemSectionRoot from '@components/MenuItem/presets/MenuItemSectionRoot';
import Section from '@components/Section';
import Text from '@components/Text';

Expand All @@ -11,8 +12,6 @@ import useTwoFactorAuthRoute from '@hooks/useTwoFactorAuthRoute';

import Navigation from '@navigation/Navigation';

import {callFunctionIfActionIsAllowed} from '@userActions/Session';

import React from 'react';
import {View} from 'react-native';

Expand All @@ -33,21 +32,19 @@ function Enable2FACard() {
<View style={styles.mb6}>
<Text>{translate('connectBankAccountStep.enable2FAText')}</Text>
</View>
<View style={styles.mhn5}>
<MenuItem.Root onPress={callFunctionIfActionIsAllowed(() => Navigation.navigate(getTwoFactorAuthRoute()))}>
<MenuItem.Row>
<MenuItem.Leading>
<MenuItem.Icon src={icons.Shield} />
</MenuItem.Leading>
<MenuItem.Content>
<MenuItem.Title>{translate('connectBankAccountStep.secureYourAccount')}</MenuItem.Title>
</MenuItem.Content>
<MenuItem.Trailing>
<MenuItem.Chevron />
</MenuItem.Trailing>
</MenuItem.Row>
</MenuItem.Root>
</View>
<MenuItemSectionRoot onPress={() => Navigation.navigate(getTwoFactorAuthRoute())}>
<MenuItem.Row>
<MenuItem.Leading>
<MenuItem.Icon src={icons.Shield} />
</MenuItem.Leading>
<MenuItem.Content>
<MenuItem.Title>{translate('connectBankAccountStep.secureYourAccount')}</MenuItem.Title>
</MenuItem.Content>
<MenuItem.Trailing>
<MenuItem.Chevron />
</MenuItem.Trailing>
</MenuItem.Row>
</MenuItemSectionRoot>
</Section>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/domain/DomainSamlPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function DomainSamlPage({route}: DomainSamlPageProps) {
subtitleMuted
isCentralPane
titleStyles={styles.accountSettingsSectionTitle}
childrenStyles={[styles.gap6, styles.pt6]}
childrenStyles={[styles.pt6]}
>
<SamlConfigurationDetailsSectionContent
accountID={domainAccountID}
Expand Down
Loading
Loading