Skip to content

Commit

Permalink
Merge pull request #35953 from codinggeek2023/issue-35932
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins authored Feb 6, 2024
2 parents ccad061 + 5e59bee commit ab472ec
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
8 changes: 8 additions & 0 deletions src/libs/shouldShowSubscriptionsMenu/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type ShouldShowSubscriptionsMenu from './types';

/**
* Indicates whether the subscription menu should show in the all settings screen
*/
const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = false;

export default shouldShowSubscriptionsMenu;
8 changes: 8 additions & 0 deletions src/libs/shouldShowSubscriptionsMenu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type ShouldShowSubscriptionsMenu from './types';

/**
* Indicates whether the subscription menu should show in the all settings screen
*/
const shouldShowSubscriptionsMenu: ShouldShowSubscriptionsMenu = true;

export default shouldShowSubscriptionsMenu;
3 changes: 3 additions & 0 deletions src/libs/shouldShowSubscriptionsMenu/types.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type ShouldShowSubscriptionsMenu = boolean;

export default ShouldShowSubscriptionsMenu;
25 changes: 15 additions & 10 deletions src/pages/home/sidebar/AllSettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
import useWaitForNavigation from '@hooks/useWaitForNavigation';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';
import shouldShowSubscriptionsMenu from '@libs/shouldShowSubscriptionsMenu';
import {hasGlobalWorkspaceSettingsRBR} from '@libs/WorkspacesSettingsUtils';
import * as Link from '@userActions/Link';
import CONST from '@src/CONST';
Expand Down Expand Up @@ -49,16 +50,20 @@ function AllSettingsScreen({policies, policyMembers}: AllSettingsScreenProps) {
focused: !isSmallScreenWidth,
brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies, policyMembers) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined,
},
{
translationKey: 'allSettingsScreen.subscriptions',
icon: Expensicons.MoneyBag,
action: () => {
Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL);
},
shouldShowRightIcon: true,
iconRight: Expensicons.NewWindow,
link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL,
},
...(shouldShowSubscriptionsMenu
? [
{
translationKey: 'allSettingsScreen.subscriptions',
icon: Expensicons.MoneyBag,
action: () => {
Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL);
},
shouldShowRightIcon: true,
iconRight: Expensicons.NewWindow,
link: CONST.OLDDOT_URLS.ADMIN_POLICIES_URL,
},
]
: []),
{
translationKey: 'allSettingsScreen.cardsAndDomains',
icon: Expensicons.CardsAndDomains,
Expand Down

0 comments on commit ab472ec

Please sign in to comment.