Skip to content

Commit

Permalink
address comment and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
hungvu193 committed May 3, 2024
1 parent 45f2288 commit 6f72680
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions src/components/SelectionScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<SectionListDataType<SelectorType>>;
/** 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
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';
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);
Expand Down

0 comments on commit 6f72680

Please sign in to comment.