Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
81a23a7
Move subscription settings to RHP - WEB
VickyStash Mar 25, 2025
934fc22
Move subscription settings to RHP - Mobile
VickyStash Mar 25, 2025
b4990e0
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Mar 27, 2025
f4b5d4f
Update prices, implement useIsNewSubscription hook
VickyStash Mar 27, 2025
8cdf3c2
Update SubscriptionPlanCard implementation
VickyStash Mar 27, 2025
c8b5499
Implement SubscriptionPlanCardActionButton component
VickyStash Mar 27, 2025
da38cc5
Fix lint errors
VickyStash Mar 27, 2025
f94cef4
Fix unit test
VickyStash Mar 27, 2025
148b51d
Implement ComparePlansModal
VickyStash Mar 28, 2025
bc37116
Bug fix, add comments to types
VickyStash Mar 28, 2025
abbe0fb
UI improvements
VickyStash Mar 28, 2025
4be56d6
Simplify handlePlanPress logic
VickyStash Mar 28, 2025
2777885
Add settings summary text
VickyStash Mar 28, 2025
4e2f31e
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Apr 1, 2025
99aeb68
Remove not necessary anymore files
VickyStash Apr 1, 2025
d310a62
Minor code improvements
VickyStash Apr 1, 2025
354490a
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Apr 2, 2025
8fbf6e3
Add members button shouldn't be displayed on mobile platforms
VickyStash Apr 2, 2025
a12db29
Fix
VickyStash Apr 2, 2025
c7f1ee8
Fix the pricing
VickyStash Apr 3, 2025
9ed1d1a
Improve isNewSubscription check
VickyStash Apr 3, 2025
624c821
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Apr 4, 2025
488f14e
Minor code improvements
VickyStash Apr 4, 2025
8a954e0
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Apr 8, 2025
adc0b70
Fix onyx key
VickyStash Apr 8, 2025
4f77303
Minor style updates
VickyStash Apr 8, 2025
1b8e0a2
Fix the border
VickyStash Apr 8, 2025
ff63ccf
Fix the border radius
VickyStash Apr 8, 2025
844f716
Fix Add members button padding
VickyStash Apr 9, 2025
7512a8c
Re-name variables
VickyStash Apr 9, 2025
022f6ff
Minor code improvements
VickyStash Apr 9, 2025
9ff42d4
Update plan card price display
VickyStash Apr 10, 2025
3720d29
Fix subscription size block position
VickyStash Apr 11, 2025
90c3b02
Block SubscriptionSetting access when necessary
VickyStash Apr 11, 2025
306ae4e
Update benefits rendering to fix scroll issues
VickyStash Apr 11, 2025
5c7c88f
Update NVP_PRIVATE_TEAM_PRICING_2025 to NVP_PRIVATE_MANUAL_TEAM_PRICI…
VickyStash Apr 11, 2025
a8e00e5
Update ONYXKEYS.NVP_PRIVATE_MANUAL_TEAM_PRICING_2025 type
VickyStash Apr 11, 2025
824ef28
Update pricing text on the Add payment card page
VickyStash Apr 11, 2025
c34ebe4
Lint fixes
VickyStash Apr 11, 2025
7b7a951
Hide the early discount offer for users on the new pricing plan
VickyStash Apr 11, 2025
7743788
Merge branch 'refs/heads/main' into VickyStash/feature/59007-subscrip…
VickyStash Apr 14, 2025
1e5e297
If user doesn't have firstPolicyDate show new pricing
VickyStash Apr 14, 2025
d7d5eaa
Update modal closing animation if user re-navigated to the next screen
VickyStash Apr 14, 2025
4cdcc5c
Apply addBottomSafeAreaPadding flag
VickyStash Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3312,6 +3312,8 @@ const CONST = {
DEFAULT: 'default',
},
SUBSCRIPTION: {
TEAM_2025_PRICING_START_DATE: new Date(2025, 3, 1),
PRICING_TYPE_2025: 'team2025Pricing',
TYPE: {
ANNUAL: 'yearly2018',
PAYPERUSE: 'monthly2018',
Expand All @@ -3327,6 +3329,7 @@ const CONST = {
[this.POLICY.TYPE.TEAM]: {
[this.SUBSCRIPTION.TYPE.ANNUAL]: 500,
[this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1000,
[this.SUBSCRIPTION.PRICING_TYPE_2025]: 500,
},
},
[this.PAYMENT_CARD_CURRENCY.AUD]: {
Expand All @@ -3337,6 +3340,7 @@ const CONST = {
[this.POLICY.TYPE.TEAM]: {
[this.SUBSCRIPTION.TYPE.ANNUAL]: 700,
[this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1400,
[this.SUBSCRIPTION.PRICING_TYPE_2025]: 800,
},
},
[this.PAYMENT_CARD_CURRENCY.GBP]: {
Expand All @@ -3347,6 +3351,7 @@ const CONST = {
[this.POLICY.TYPE.TEAM]: {
[this.SUBSCRIPTION.TYPE.ANNUAL]: 400,
[this.SUBSCRIPTION.TYPE.PAYPERUSE]: 800,
[this.SUBSCRIPTION.PRICING_TYPE_2025]: 500,
},
},
[this.PAYMENT_CARD_CURRENCY.NZD]: {
Expand All @@ -3357,6 +3362,7 @@ const CONST = {
[this.POLICY.TYPE.TEAM]: {
[this.SUBSCRIPTION.TYPE.ANNUAL]: 800,
[this.SUBSCRIPTION.TYPE.PAYPERUSE]: 1600,
[this.SUBSCRIPTION.PRICING_TYPE_2025]: 900,
},
},
};
Expand Down
8 changes: 8 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ const ONYXKEYS = {
/** A timestamp of when the last full reconnect should have been done */
NVP_RECONNECT_APP_IF_FULL_RECONNECT_BEFORE: 'nvp_reconnectAppIfFullReconnectBefore',

/** User's first policy creation date */
NVP_PRIVATE_FIRST_POLICY_CREATED_DATE: 'nvp_private_firstPolicyCreatedDate',

/** If the user should see the team 2025 subscription pricing */
NVP_PRIVATE_MANUAL_TEAM_PRICING_2025: 'nvp_private_manualTeamPricing2025',

/** Plaid data (access tokens, bank accounts ...) */
PLAID_DATA: 'plaidData',

Expand Down Expand Up @@ -1094,6 +1100,8 @@ type OnyxValuesMapping = {
[ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END]: number;
[ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL]: string | undefined;
[ONYXKEYS.NVP_RECONNECT_APP_IF_FULL_RECONNECT_BEFORE]: string;
[ONYXKEYS.NVP_PRIVATE_FIRST_POLICY_CREATED_DATE]: string;
[ONYXKEYS.NVP_PRIVATE_MANUAL_TEAM_PRICING_2025]: string;
[ONYXKEYS.NVP_PRIVATE_CANCELLATION_DETAILS]: OnyxTypes.CancellationDetails[];
[ONYXKEYS.ROOM_MEMBERS_USER_SEARCH_PHRASE]: string;
[ONYXKEYS.APPROVAL_WORKFLOW]: OnyxTypes.ApprovalWorkflowOnyx;
Expand Down
1 change: 1 addition & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const ROUTES = {
route: 'settings/subscription/subscription-size',
getRoute: (canChangeSize: 0 | 1) => `settings/subscription/subscription-size?canChangeSize=${canChangeSize as number}` as const,
},
SETTINGS_SUBSCRIPTION_SETTINGS_DETAILS: 'settings/subscription/details',
SETTINGS_SUBSCRIPTION_ADD_PAYMENT_CARD: 'settings/subscription/add-payment-card',
SETTINGS_SUBSCRIPTION_CHANGE_BILLING_CURRENCY: 'settings/subscription/change-billing-currency',
SETTINGS_SUBSCRIPTION_CHANGE_PAYMENT_CURRENCY: 'settings/subscription/add-payment-card/change-payment-currency',
Expand Down
1 change: 1 addition & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ const SCREENS = {
SUBSCRIPTION: {
ROOT: 'Settings_Subscription',
SIZE: 'Settings_Subscription_Size',
SETTINGS_DETAILS: 'Settings_Subscription_Details',
ADD_PAYMENT_CARD: 'Settings_Subscription_Add_Payment_Card',
DISABLE_AUTO_RENEW_SURVEY: 'Settings_Subscription_DisableAutoRenewSurvey',
CHANGE_BILLING_CURRENCY: 'Settings_Subscription_Change_Billing_Currency',
Expand Down
6 changes: 4 additions & 2 deletions src/components/Modal/BottomDockedModal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type GestureProps = {
deviceWidth?: number | null;
};

type AnimationOut = ValueOf<Pick<ReactNativeModalProps, 'animationOut'>>;

type ModalProps = ViewProps &
GestureProps & {
/** Content inside the modal */
Expand Down Expand Up @@ -50,7 +52,7 @@ type ModalProps = ViewProps &
animationInTiming?: number;

/** Enum for animation type when modal disappears */
animationOut?: ValueOf<Pick<ReactNativeModalProps, 'animationOut'>>;
animationOut?: AnimationOut;

/** Duration of the animation when modal disappears */
animationOutTiming?: number;
Expand Down Expand Up @@ -147,4 +149,4 @@ type ContainerProps = {
};

export default ModalProps;
export type {BackdropProps, ContainerProps, GestureProps};
export type {BackdropProps, ContainerProps, GestureProps, AnimationOut};
4 changes: 3 additions & 1 deletion src/components/Section/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ function Section({
iconContainerStyles={[styles.flexGrow0, styles.justifyContentStart, iconContainerStyles]}
/>
)}
<View style={[styles.flexShrink1]}>{renderTitle ? renderTitle() : <Text style={[styles.textHeadline, styles.cardSectionTitle, titleStyles]}>{title}</Text>}</View>
<View style={[styles.flexShrink1, styles.w100]}>
{renderTitle ? renderTitle() : <Text style={[styles.textHeadline, styles.cardSectionTitle, titleStyles]}>{title}</Text>}
</View>
{cardLayout === CARD_LAYOUT.ICON_ON_RIGHT && (
<IconSection
width={iconWidth}
Expand Down
21 changes: 21 additions & 0 deletions src/hooks/useHasTeam2025Pricing.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {differenceInDays} from 'date-fns';
import {useOnyx} from 'react-native-onyx';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';

function useHasTeam2025Pricing(): boolean {
const [firstPolicyDate] = useOnyx(ONYXKEYS.NVP_PRIVATE_FIRST_POLICY_CREATED_DATE);
const [hasManualTeamPricing2025] = useOnyx(ONYXKEYS.NVP_PRIVATE_MANUAL_TEAM_PRICING_2025);

if (hasManualTeamPricing2025) {
return true;
}

if (!firstPolicyDate) {
return true;
}

return differenceInDays(firstPolicyDate, CONST.SUBSCRIPTION.TEAM_2025_PRICING_START_DATE) >= 0;
}

export default useHasTeam2025Pricing;
3 changes: 2 additions & 1 deletion src/hooks/usePreferredCurrency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ function usePreferredCurrency(): PreferredCurrency {
return paymentCardCurrency;
}

const currentUserLocalCurrency = (personalDetails?.[session?.accountID ?? '-1']?.localCurrencyCode ?? CONST.PAYMENT_CARD_CURRENCY.USD) as PreferredCurrency;
const currentUserLocalCurrency = (personalDetails?.[session?.accountID ?? CONST.DEFAULT_NUMBER_ID]?.localCurrencyCode ?? CONST.PAYMENT_CARD_CURRENCY.USD) as PreferredCurrency;

return Object.values(CONST.PAYMENT_CARD_CURRENCY).includes(currentUserLocalCurrency) ? currentUserLocalCurrency : CONST.PAYMENT_CARD_CURRENCY.USD;
}

export default usePreferredCurrency;
export type {PreferredCurrency};
11 changes: 9 additions & 2 deletions src/hooks/useSubscriptionPrice.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
import {useOnyx} from 'react-native-onyx';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import useHasTeam2025Pricing from './useHasTeam2025Pricing';
import usePreferredCurrency from './usePreferredCurrency';
import useSubscriptionPlan from './useSubscriptionPlan';

function useSubscriptionPrice(): number {
const preferredCurrency = usePreferredCurrency();
const subscriptionPlan = useSubscriptionPlan();
const hasTeam2025Pricing = useHasTeam2025Pricing();
const [privateSubscription] = useOnyx(ONYXKEYS.NVP_PRIVATE_SUBSCRIPTION);
const subscriptionType = privateSubscription?.type;

if (!subscriptionPlan || !privateSubscription?.type) {
if (!subscriptionPlan || !subscriptionType) {
return 0;
}

return CONST.SUBSCRIPTION_PRICES[preferredCurrency][subscriptionPlan][privateSubscription.type];
if (hasTeam2025Pricing && subscriptionPlan === CONST.POLICY.TYPE.TEAM) {
return CONST.SUBSCRIPTION_PRICES[preferredCurrency][subscriptionPlan][CONST.SUBSCRIPTION.PRICING_TYPE_2025];
}

return CONST.SUBSCRIPTION_PRICES[preferredCurrency][subscriptionPlan][subscriptionType];
}

export default useSubscriptionPrice;
65 changes: 52 additions & 13 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ import type {
SubscriptionCommitmentParams,
SubscriptionSettingsRenewsOnParams,
SubscriptionSettingsSaveUpToParams,
SubscriptionSettingsSummaryParams,
SubscriptionSizeParams,
SyncStageNameConnectionsParams,
TaskCreatedActionParams,
Expand Down Expand Up @@ -229,6 +230,7 @@ import type {
WorkspaceOwnerWillNeedToAddOrUpdatePaymentCardParams,
WorkspaceYouMayJoin,
YourPlanPriceParams,
YourPlanPriceValueParams,
ZipCodeExampleFormatParams,
} from './params';
import type {TranslationDeepObject} from './types';
Expand Down Expand Up @@ -5815,38 +5817,60 @@ const translations = {
},
yourPlan: {
title: 'Your plan',
exploreAllPlans: 'Explore all plans',
customPricing: 'Custom pricing',
asLowAs: ({price}: YourPlanPriceValueParams) => `as low as ${price} per active member/month`,
pricePerMemberMonth: ({price}: YourPlanPriceValueParams) => `${price} per member/month`,
pricePerMemberPerMonth: ({price}: YourPlanPriceValueParams) => `${price} per member per month`,
perMemberMonth: 'per member/month',
collect: {
title: 'Collect',
description: 'The SMB plan that gives you expense, travel, and chat.',
priceAnnual: ({lower, upper}: YourPlanPriceParams) => `From ${lower}/active member with the Expensify Card, ${upper}/active member without the Expensify Card.`,
pricePayPerUse: ({lower, upper}: YourPlanPriceParams) => `From ${lower}/active member with the Expensify Card, ${upper}/active member without the Expensify Card.`,
benefit1: 'Unlimited SmartScans and distance tracking',
benefit2: 'Expensify Cards with Smart Limits',
benefit3: 'Bill pay and invoicing',
benefit4: 'Expense approvals',
benefit5: 'ACH reimbursement',
benefit6: 'QuickBooks and Xero integrations',
benefit7: 'Custom insights and reporting',
benefit1: 'Receipt scanning',
benefit2: 'Reimbursements',
benefit3: 'Corporate card management',
benefit4: 'Expense and travel approvals',
benefit5: 'Travel booking and rules',
benefit6: 'QuickBooks/Xero integrations',
benefit7: 'Chat on expenses, reports, and rooms',
benefit8: 'AI and human support',
},
control: {
title: 'Control',
description: 'Expense, travel, and chat for larger businesses.',
priceAnnual: ({lower, upper}: YourPlanPriceParams) => `From ${lower}/active member with the Expensify Card, ${upper}/active member without the Expensify Card.`,
pricePayPerUse: ({lower, upper}: YourPlanPriceParams) => `From ${lower}/active member with the Expensify Card, ${upper}/active member without the Expensify Card.`,
benefit1: 'Everything in Collect, plus:',
benefit2: 'NetSuite and Sage Intacct integrations',
benefit3: 'Certinia and Workday sync',
benefit4: 'Multiple expense approvers',
benefit5: 'SAML/SSO',
benefit6: 'Budgeting',
benefit1: 'Everything in the Collect plan',
benefit2: 'Multi-level approval workflows',
benefit3: 'Custom expense rules',
benefit4: 'ERP integrations (NetSuite, Sage Intacct, Oracle)',
benefit5: 'HR integrations (Workday, Certinia)',
benefit6: 'SAML/SSO',
benefit7: 'Custom insights and reporting',
benefit8: 'Budgeting',
},
thisIsYourCurrentPlan: 'This is your current plan',
downgrade: 'Downgrade to Collect',
upgrade: 'Upgrade to Control',
addMembers: 'Add members',
saveWithExpensifyTitle: 'Save with the Expensify Card',
saveWithExpensifyDescription: 'Use our savings calculator to see how cash back from the Expensify Card can reduce your Expensify bill.',
saveWithExpensifyButton: 'Learn more',
},
compareModal: {
comparePlans: 'Compare Plans',
unlockTheFeatures: 'Unlock the features you need with the plan that’s right for you. ',
viewOurPricing: 'View our pricing page',
forACompleteFeatureBreakdown: ' for a complete feature breakdown of each of our plans.',
},
details: {
title: 'Subscription details',
annual: 'Annual subscription',
taxExempt: 'Request tax exempt status',
taxExemptEnabled: 'Tax exempt',
taxExemptStatus: 'Tax exempt status',
payPerUse: 'Pay-per-use',
subscriptionSize: 'Subscription size',
headsUp:
Expand Down Expand Up @@ -5879,6 +5903,12 @@ const translations = {
},
subscriptionSettings: {
title: 'Subscription settings',
summary: ({subscriptionType, subscriptionSize, autoRenew, autoIncrease}: SubscriptionSettingsSummaryParams) =>
`Subscription type: ${subscriptionType}, Subscription size: ${subscriptionSize}, Auto renew: ${autoRenew}, Auto increase annual seats: ${autoIncrease}`,
none: 'none',
on: 'on',
off: 'off',
annual: 'Annual',
autoRenew: 'Auto-renew',
autoIncrease: 'Auto-increase annual seats',
saveUpTo: ({amountWithCurrency}: SubscriptionSettingsSaveUpToParams) => `Save up to ${amountWithCurrency}/month per active member`,
Expand All @@ -5888,6 +5918,15 @@ const translations = {
helpUsImprove: 'Help us improve Expensify',
whatsMainReason: "What's the main reason you're disabling auto-renew?",
renewsOn: ({date}: SubscriptionSettingsRenewsOnParams) => `Renews on ${date}.`,
pricingConfiguration: 'Pricing depends on configuration. For the lowest price, choose an annual subscription and get the Expensify Card.',
learnMore: {
part1: 'Learn more on our ',
pricingPage: 'pricing page',
part2: ' or chat with our team in your ',
adminsRoom: '#admins room.',
},
estimatedPrice: 'Estimated price',
changesBasedOn: 'This changes based on your Expensify Card usage and the subscription options below.',
},
requestEarlyCancellation: {
title: 'Request early cancellation',
Expand Down
Loading