diff --git a/src/libs/shouldShowSubscriptionsMenu/index.native.ts b/src/libs/shouldShowSubscriptionsMenu/index.native.ts new file mode 100644 index 000000000000..c98302e9a87d --- /dev/null +++ b/src/libs/shouldShowSubscriptionsMenu/index.native.ts @@ -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; diff --git a/src/libs/shouldShowSubscriptionsMenu/index.ts b/src/libs/shouldShowSubscriptionsMenu/index.ts new file mode 100644 index 000000000000..2f2b7f17c2c5 --- /dev/null +++ b/src/libs/shouldShowSubscriptionsMenu/index.ts @@ -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; diff --git a/src/libs/shouldShowSubscriptionsMenu/types.tsx b/src/libs/shouldShowSubscriptionsMenu/types.tsx new file mode 100644 index 000000000000..e72b55234639 --- /dev/null +++ b/src/libs/shouldShowSubscriptionsMenu/types.tsx @@ -0,0 +1,3 @@ +type ShouldShowSubscriptionsMenu = boolean; + +export default ShouldShowSubscriptionsMenu; diff --git a/src/pages/home/sidebar/AllSettingsScreen.tsx b/src/pages/home/sidebar/AllSettingsScreen.tsx index aa308d523db4..0406c38cf659 100644 --- a/src/pages/home/sidebar/AllSettingsScreen.tsx +++ b/src/pages/home/sidebar/AllSettingsScreen.tsx @@ -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'; @@ -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,