Repository navigation
[Payment card / Subscription] Rollout feature: replace Subscriptions menu item #45089
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
Changes from all commits
6db5f93
0209242
54e7bab
5f113c0
e64c251
0dd8a1c
0373eca
3c141d8
fa63667
2505320
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| import React, {useMemo} from 'react'; | ||||||
| import type {OnyxCollection} from 'react-native-onyx'; | ||||||
| import {withOnyx} from 'react-native-onyx'; | ||||||
| import {useOnyx, withOnyx} from 'react-native-onyx'; | ||||||
| import Breadcrumbs from '@components/Breadcrumbs'; | ||||||
| import * as Expensicons from '@components/Icon/Expensicons'; | ||||||
| import MenuItemList from '@components/MenuItemList'; | ||||||
|
|
@@ -11,7 +11,6 @@ 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'; | ||||||
|
|
@@ -32,6 +31,8 @@ function AllSettingsScreen({policies}: AllSettingsScreenProps) { | |||||
| const {translate} = useLocalize(); | ||||||
| const {isSmallScreenWidth} = useWindowDimensions(); | ||||||
|
|
||||||
| const [privateSubscription] = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION); | ||||||
|
|
||||||
| /** | ||||||
| * Retuns a list of menu items data for All workspaces settings | ||||||
| * @returns {Object} object with translationKey, style and items | ||||||
|
|
@@ -49,10 +50,10 @@ function AllSettingsScreen({policies}: AllSettingsScreenProps) { | |||||
| focused: !isSmallScreenWidth, | ||||||
| brickRoadIndicator: hasGlobalWorkspaceSettingsRBR(policies) ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : undefined, | ||||||
| }, | ||||||
| ...(shouldShowSubscriptionsMenu | ||||||
| ...(privateSubscription | ||||||
| ? [ | ||||||
| { | ||||||
| translationKey: 'allSettingsScreen.subscriptions', | ||||||
| translationKey: 'allSettingsScreen.subscription', | ||||||
| icon: Expensicons.MoneyBag, | ||||||
| action: () => { | ||||||
| Link.openOldDotLink(CONST.OLDDOT_URLS.ADMIN_POLICIES_URL); | ||||||
|
|
@@ -89,7 +90,7 @@ function AllSettingsScreen({policies}: AllSettingsScreenProps) { | |||||
| hoverAndPressStyle: styles.hoveredComponentBG, | ||||||
| brickRoadIndicator: item.brickRoadIndicator, | ||||||
| })); | ||||||
| }, [isSmallScreenWidth, styles.hoveredComponentBG, styles.sectionMenuItem, translate, waitForNavigate, policies]); | ||||||
| }, [isSmallScreenWidth, policies, privateSubscription, waitForNavigate, translate, styles]); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB as this component is not used anywhere in the app |
||||||
|
|
||||||
| return ( | ||||||
| <ScreenWrapper | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1434,6 +1434,11 @@ const styles = (theme: ThemeColors) => | |||||||||
| flex: 1, | ||||||||||
| }, | ||||||||||
|
|
||||||||||
| lhnSuccessText: { | ||||||||||
| color: theme.success, | ||||||||||
| fontWeight: FontUtils.fontWeight.bold, | ||||||||||
| }, | ||||||||||
|
|
||||||||||
|
Comment on lines
+1437
to
+1441
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB: unused style |
||||||||||
| signInPageHeroCenter: { | ||||||||||
| position: 'absolute', | ||||||||||
| top: 0, | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not considering an active subscription plan based on control/collect workspace for display of
subscriptionmenu resulted in #45720