Skip to content

Commit

Permalink
Merge pull request Expensify#54721 from nkdengineer/fix/54575
Browse files Browse the repository at this point in the history
fix: Features in Workspace LHN are not in the same order
  • Loading branch information
deetergp authored Jan 3, 2025
2 parents d60500a + bc3351d commit 10de5ef
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/pages/workspace/WorkspaceInitialPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,6 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
App.confirmReadyToOpenApp();
}, []);

if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_INVOICES_ENABLED]) {
const currencyCode = policy?.outputCurrency ?? CONST.CURRENCY.USD;

protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.invoices',
icon: Expensicons.InvoiceGeneric,
action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_INVOICES.getRoute(policyID)))),
routeName: SCREENS.WORKSPACE.INVOICES,
badgeText: CurrencyUtils.convertToDisplayString(policy?.invoice?.bankAccount?.stripeConnectAccountBalance ?? 0, currencyCode),
});
}

if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_DISTANCE_RATES_ENABLED]) {
protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.distanceRates',
Expand Down Expand Up @@ -263,6 +251,18 @@ function WorkspaceInitialPage({policyDraft, policy: policyProp, route}: Workspac
});
}

if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_INVOICES_ENABLED]) {
const currencyCode = policy?.outputCurrency ?? CONST.CURRENCY.USD;

protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.invoices',
icon: Expensicons.InvoiceGeneric,
action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_INVOICES.getRoute(policyID)))),
routeName: SCREENS.WORKSPACE.INVOICES,
badgeText: CurrencyUtils.convertToDisplayString(policy?.invoice?.bankAccount?.stripeConnectAccountBalance ?? 0, currencyCode),
});
}

if (featureStates?.[CONST.POLICY.MORE_FEATURES.ARE_CATEGORIES_ENABLED]) {
protectedCollectPolicyMenuItems.push({
translationKey: 'workspace.common.categories',
Expand Down

0 comments on commit 10de5ef

Please sign in to comment.