diff --git a/src/components/SelectionScreen.tsx b/src/components/SelectionScreen.tsx index df650dffd40e..470437a5bd3f 100644 --- a/src/components/SelectionScreen.tsx +++ b/src/components/SelectionScreen.tsx @@ -17,13 +17,21 @@ type SelectorType = ListItem & { }; type SelectionScreenProps = { + /** Used to set the testID for tests */ displayName: string; + /** Title of the selection component */ title: TranslationPaths; + /** Custom content to display in the header */ headerContent?: React.ReactNode; + /** Sections for the section list */ sections: Array>; + /** Default renderer for every item in the list */ listItem: typeof RadioListItem | typeof UserListItem | typeof TableListItem; + /** Item `keyForList` to focus initially */ initiallyFocusedOptionKey?: string | null | undefined; + /** Callback to fire when a row is pressed */ onSelectRow: (selection: SelectorType) => void; + /** Callback to fire when back button is pressed */ onBackButtonPress: () => void; /** The current policyID */ policyID: string; diff --git a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx index 7ce1850b13b6..008a6c1e7f7d 100644 --- a/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx +++ b/src/pages/workspace/accounting/xero/advanced/XeroAdvancedPage.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react'; +import React, {useMemo} from 'react'; import ConnectionLayout from '@components/ConnectionLayout'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; @@ -6,23 +6,23 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Connections from '@libs/actions/connections'; import * as ErrorUtils from '@libs/ErrorUtils'; +import Navigation from '@libs/Navigation/Navigation'; import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnections'; import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import ToggleSettingOptionRow from '@pages/workspace/workflows/ToggleSettingsOptionRow'; import * as Policy from '@userActions/Policy'; import CONST from '@src/CONST'; import ROUTES from '@src/ROUTES'; -import Navigation from '@libs/Navigation/Navigation'; function XeroAdvancedPage({policy}: WithPolicyConnectionsProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const policyID = policy?.id ?? ''; - const xeroConfig = policy?.connections?.xero?.config; - const {autoSync, pendingFields, sync, } = xeroConfig ?? {}; + const xeroConfig = policy?.connections?.xero?.config; + const {autoSync, pendingFields, sync} = xeroConfig ?? {}; const {bankAccounts} = policy?.connections?.xero?.data ?? {}; - + const selectedBankAccountName = useMemo(() => { const {invoiceCollectionsAccountID} = sync ?? {}; const selectedAccount = (bankAccounts ?? []).find((bank) => bank.id === invoiceCollectionsAccountID);