Skip to content

Commit

Permalink
Merge pull request #42754 from JKobrynski/feature-payment-card-subscr…
Browse files Browse the repository at this point in the history
…iption

Merge the feature-payment-card-subscription feature branch into main
  • Loading branch information
amyevans authored May 29, 2024
2 parents d4d2170 + a691b07 commit eec5cf1
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const ROUTES = {
SETTINGS_TIMEZONE_SELECT: 'settings/profile/timezone/select',
SETTINGS_PRONOUNS: 'settings/profile/pronouns',
SETTINGS_PREFERENCES: 'settings/preferences',
SETTINGS_SUBSCRIPTION: 'settings/subscription',
SETTINGS_PRIORITY_MODE: 'settings/preferences/priority-mode',
SETTINGS_LANGUAGE: 'settings/preferences/language',
SETTINGS_THEME: 'settings/preferences/theme',
Expand Down
4 changes: 4 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ const SCREENS = {
RESPONSE: 'Settings_ExitSurvey_Response',
CONFIRM: 'Settings_ExitSurvey_Confirm',
},

SUBSCRIPTION: {
ROOT: 'Settings_Subscription',
},
},
SAVE_THE_WORLD: {
ROOT: 'SaveTheWorld_Root',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,7 @@ export default {
distanceRates: 'Distance rates',
welcomeNote: ({workspaceName}: WelcomeNoteParams) =>
`You have been invited to ${workspaceName || 'a workspace'}! Download the Expensify mobile app at use.expensify.com/download to start tracking your expenses.`,
subscription: 'Subscription',
},
qbo: {
importDescription: 'Choose which coding configurations are imported from QuickBooks Online to Expensify.',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,7 @@ export default {
distanceRates: 'Tasas de distancia',
welcomeNote: ({workspaceName}: WelcomeNoteParams) =>
`¡Has sido invitado a ${workspaceName}! Descargue la aplicación móvil Expensify en use.expensify.com/download para comenzar a rastrear sus gastos.`,
subscription: 'Suscripción',
},
qbo: {
importDescription: 'Elige que configuraciónes de codificación son importadas desde QuickBooks Online a Expensify.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const settingsScreens = {
[SCREENS.SETTINGS.ABOUT]: () => require('../../../../../pages/settings/AboutPage/AboutPage').default as React.ComponentType,
[SCREENS.SETTINGS.TROUBLESHOOT]: () => require('../../../../../pages/settings/Troubleshoot/TroubleshootPage').default as React.ComponentType,
[SCREENS.SETTINGS.SAVE_THE_WORLD]: () => require('../../../../../pages/TeachersUnite/SaveTheWorldPage').default as React.ComponentType,
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: () => require('../../../../../pages/settings/Subscription/SubscriptionSettingsPage').default as React.ComponentType,
} satisfies Screens;

function BaseCentralPaneNavigator() {
Expand All @@ -34,6 +35,7 @@ function BaseCentralPaneNavigator() {
// Prevent unnecessary scrolling
cardStyle: styles.cardStyleNavigator,
};

return (
<Stack.Navigator screenOptions={options}>
<Stack.Screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const CENTRAL_PANE_TO_RHP_MAPPING: Partial<Record<CentralPaneName, string[]>> =
[SCREENS.SETTINGS.SAVE_THE_WORLD]: [SCREENS.I_KNOW_A_TEACHER, SCREENS.INTRO_SCHOOL_PRINCIPAL, SCREENS.I_AM_A_TEACHER],
[SCREENS.SETTINGS.TROUBLESHOOT]: [SCREENS.SETTINGS.CONSOLE],
[SCREENS.SEARCH.CENTRAL_PANE]: [SCREENS.SEARCH.REPORT_RHP],
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: [],
};

export default CENTRAL_PANE_TO_RHP_MAPPING;
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const TAB_TO_CENTRAL_PANE_MAPPING: Record<BottomTabName, CentralPaneName[]> = {
SCREENS.SETTINGS.WORKSPACES,
SCREENS.SETTINGS.SAVE_THE_WORLD,
SCREENS.SETTINGS.TROUBLESHOOT,
SCREENS.SETTINGS.SUBSCRIPTION.ROOT,
],
};

Expand Down
1 change: 1 addition & 0 deletions src/libs/Navigation/linkingConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const config: LinkingOptions<RootStackParamList>['config'] = {
[SCREENS.SETTINGS.WORKSPACES]: ROUTES.SETTINGS_WORKSPACES,
[SCREENS.SEARCH.CENTRAL_PANE]: ROUTES.SEARCH.route,
[SCREENS.SETTINGS.SAVE_THE_WORLD]: ROUTES.SETTINGS_SAVE_THE_WORLD,
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: ROUTES.SETTINGS_SUBSCRIPTION,
},
},
[SCREENS.NOT_FOUND]: '*',
Expand Down
2 changes: 2 additions & 0 deletions src/libs/Navigation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type CentralPaneNavigatorParamList = {
policyIDs?: string;
};
[SCREENS.SETTINGS.SAVE_THE_WORLD]: undefined;
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: undefined;
};

type BackToParams = {
Expand Down Expand Up @@ -99,6 +100,7 @@ type SettingsNavigatorParamList = {
backTo: Routes;
};
[SCREENS.SETTINGS.PREFERENCES.ROOT]: undefined;
[SCREENS.SETTINGS.SUBSCRIPTION.ROOT]: undefined;
[SCREENS.SETTINGS.PREFERENCES.PRIORITY_MODE]: undefined;
[SCREENS.SETTINGS.PREFERENCES.LANGUAGE]: undefined;
[SCREENS.SETTINGS.PREFERENCES.THEME]: undefined;
Expand Down
27 changes: 27 additions & 0 deletions src/pages/settings/Subscription/SubscriptionSettingsPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import * as Illustrations from '@components/Icon/Illustrations';
import ScreenWrapper from '@components/ScreenWrapper';
import useLocalize from '@hooks/useLocalize';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';

function SubscriptionSettingsPage() {
const {isSmallScreenWidth} = useWindowDimensions();
const {translate} = useLocalize();

return (
<ScreenWrapper testID={SubscriptionSettingsPage.displayName}>
<HeaderWithBackButton
title={translate('workspace.common.subscription')}
onBackButtonPress={() => Navigation.goBack()}
shouldShowBackButton={isSmallScreenWidth}
icon={Illustrations.CreditCardsNew}
/>
</ScreenWrapper>
);
}

SubscriptionSettingsPage.displayName = 'SubscriptionSettingsPage';

export default SubscriptionSettingsPage;

0 comments on commit eec5cf1

Please sign in to comment.