Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Subscriptions menu item on iOS and Android native #35953

Merged
merged 11 commits into from
Feb 6, 2024
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
Loading