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

Fix/54842 #54920

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ import type {
WorkspaceLockedPlanTypeParams,
WorkspaceMemberList,
WorkspaceOwnerWillNeedToAddOrUpdatePaymentCardParams,
WorkspacePriceParams,
WorkspaceYouMayJoin,
YourPlanPriceParams,
ZipCodeExampleFormatParams,
Expand Down Expand Up @@ -4382,7 +4383,7 @@ const translations = {
title: 'Upgrade to the Control plan',
note: 'Unlock our most powerful features, including:',
benefits: {
note: 'The Control plan starts at $9 per active member per month.',
note: ({price}: WorkspacePriceParams) => `The Control plan starts at ${price} per active member per month.`,
learnMore: 'Learn more',
pricing: 'about our plans and pricing.',
benefit1: 'Advanced accounting connections (NetSuite, Sage Intacct, and more)',
Expand Down
3 changes: 2 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ import type {
WorkspaceLockedPlanTypeParams,
WorkspaceMemberList,
WorkspaceOwnerWillNeedToAddOrUpdatePaymentCardParams,
WorkspacePriceParams,
WorkspaceYouMayJoin,
YourPlanPriceParams,
ZipCodeExampleFormatParams,
Expand Down Expand Up @@ -4448,7 +4449,7 @@ const translations = {
title: 'Mejorar al plan Controlar',
note: 'Desbloquea nuestras funciones más potentes, incluyendo:',
benefits: {
note: 'El plan Controlar comienza desde $9 por miembro activo al mes.',
note: ({price}: WorkspacePriceParams) => `El plan Controlar comienza desde ${price} por miembro activo al mes.`,
learnMore: 'Más información',
pricing: 'sobre nuestros planes y precios.',
benefit1: 'Conexiones avanzadas de contabilidad (NetSuite, Sage Intacct y más)',
Expand Down
3 changes: 3 additions & 0 deletions src/languages/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ type AccountOwnerParams = {accountOwnerEmail: string};

type ExportedToIntegrationParams = {label: string; markedManually?: boolean; inProgress?: boolean; lastModified?: string};

type WorkspacePriceParams = {price: string};

type IntegrationsMessageParams = {
label: string;
result: {
Expand Down Expand Up @@ -724,6 +726,7 @@ export type {
ReportArchiveReasonsClosedParams,
ReportArchiveReasonsMergedParams,
ReportPolicyNameParams,
WorkspacePriceParams,
ReportArchiveReasonsInvoiceReceiverPolicyDeletedParams,
ReportArchiveReasonsRemovedFromPolicyParams,
RequestAmountParams,
Expand Down
5 changes: 3 additions & 2 deletions src/pages/workspace/upgrade/GenericFeaturesView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ type GenericFeaturesViewProps = {
buttonDisabled?: boolean;
loading?: boolean;
onUpgrade: () => void;
formattedPrice: string;
};

function GenericFeaturesView({onUpgrade, buttonDisabled, loading}: GenericFeaturesViewProps) {
function GenericFeaturesView({onUpgrade, buttonDisabled, loading, formattedPrice}: GenericFeaturesViewProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isExtraSmallScreenWidth} = useResponsiveLayout();
Expand Down Expand Up @@ -51,7 +52,7 @@ function GenericFeaturesView({onUpgrade, buttonDisabled, loading}: GenericFeatur
</View>
))}
<Text style={[styles.textNormal, styles.textSupporting, styles.mt4]}>
{translate('workspace.upgrade.commonFeatures.benefits.note')}{' '}
{translate('workspace.upgrade.commonFeatures.benefits.note', {price: formattedPrice})}{' '}
<TextLink
style={[styles.link]}
onPress={() => Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION)}
Expand Down
10 changes: 6 additions & 4 deletions src/pages/workspace/upgrade/UpgradeIntro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,19 @@ function UpgradeIntro({feature, onUpgrade, buttonDisabled, loading, isCategorizi
const preferredCurrency = usePreferredCurrency();

const formattedPrice = React.useMemo(() => {
const upgradePlan = isCategorizing ? CONST.POLICY.TYPE.TEAM : CONST.POLICY.TYPE.CORPORATE;
const upgradeCurrency = Object.hasOwn(CONST.SUBSCRIPTION_PRICES, preferredCurrency) ? preferredCurrency : CONST.PAYMENT_CARD_CURRENCY.USD;
const upgradePrice = CONST.SUBSCRIPTION_PRICES[upgradeCurrency][upgradePlan][CONST.SUBSCRIPTION.TYPE.ANNUAL];
return `${convertToShortDisplayString(upgradePrice, upgradeCurrency)} `;
return convertToShortDisplayString(
CONST.SUBSCRIPTION_PRICES[upgradeCurrency][isCategorizing ? CONST.POLICY.TYPE.TEAM : CONST.POLICY.TYPE.CORPORATE][CONST.SUBSCRIPTION.TYPE.ANNUAL],
upgradeCurrency,
);
}, [preferredCurrency, isCategorizing]);

if (!feature) {
return (
<GenericFeaturesView
onUpgrade={onUpgrade}
buttonDisabled={buttonDisabled}
formattedPrice={formattedPrice}
loading={loading}
/>
);
Expand Down Expand Up @@ -87,7 +89,7 @@ function UpgradeIntro({feature, onUpgrade, buttonDisabled, loading, isCategorizi
<Text style={[styles.textNormal, styles.textSupporting, styles.mb4]}>{translate(feature.description)}</Text>
<Text style={[styles.textNormal, styles.textSupporting]}>
{translate(`workspace.upgrade.${feature.id}.onlyAvailableOnPlan`)}
<Text style={[styles.textSupporting, styles.textBold]}>{formattedPrice}</Text>
<Text style={[styles.textSupporting, styles.textBold]}>{`${formattedPrice} `}</Text>
{translate(`workspace.upgrade.pricing.perActiveMember`)}
</Text>
</View>
Expand Down
Loading