Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .changeset/thin-poems-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@clerk/localizations': patch
'@clerk/clerk-js': patch
'@clerk/types': patch
---

Show annual amount in the subscriptions list if the subscription has annual plan period
4 changes: 4 additions & 0 deletions packages/clerk-js/src/core/resources/CommercePlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export class CommercePlan extends BaseResource implements CommercePlanResource {
name!: string;
amount!: number;
amountFormatted!: string;
annualAmount!: number;
annualAmountFormatted!: string;
annualMonthlyAmount!: number;
annualMonthlyAmountFormatted!: string;
currencySymbol!: string;
Expand Down Expand Up @@ -35,6 +37,8 @@ export class CommercePlan extends BaseResource implements CommercePlanResource {
this.name = data.name;
this.amount = data.amount;
this.amountFormatted = data.amount_formatted;
this.annualAmount = data.annual_amount;
this.annualAmountFormatted = data.annual_amount_formatted;
this.annualMonthlyAmount = data.annual_monthly_amount;
this.annualMonthlyAmountFormatted = data.annual_monthly_amount_formatted;
this.currencySymbol = data.currency_symbol;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ export function SubscriptionsList() {
<Text variant='subtitle'>
{subscription.plan.currencySymbol}
{subscription.planPeriod === 'annual'
? subscription.plan.annualMonthlyAmountFormatted
? subscription.plan.annualAmountFormatted
: subscription.plan.amountFormatted}
{subscription.plan.amount > 0 && (
{(subscription.plan.amount > 0 || subscription.plan.annualAmount > 0) && (
<Span
sx={t => ({
color: t.colors.$colorTextSecondary,
Expand All @@ -143,7 +143,11 @@ export function SubscriptionsList() {
marginInline: t.space.$1,
},
})}
localizationKey={localizationKeys('commerce.month')}
localizationKey={
subscription.planPeriod === 'annual'
? localizationKeys('commerce.year')
: localizationKeys('commerce.month')
}
/>
)}
</Text>
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ar-SA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const arSA: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'أنشاء منظمة',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/be-BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const beBY: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Стварыць арганізацыю',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/bg-BG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const bgBG: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Създаване на организация',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ca-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const caES: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Crea organització',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/cs-CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const csCZ: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Vytvořit organizaci',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/da-DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const daDK: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Opret organisation',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const deDE: LocalizationResource = {
switchPlan: 'Zu diesem Plan wechseln',
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Organisation erstellen',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/el-GR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const elGR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Δημιουργία οργανισμού',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-GB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const enGB: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Create organisation',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const enUS: LocalizationResource = {
switchPlan: 'Switch to this plan',
switchToAnnual: 'Switch to annual',
viewFeatures: 'View features',
year: 'Year',
},
createOrganization: {
formButtonSubmit: 'Create organization',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const esES: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Crear organización',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/es-MX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const esMX: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Crear organización',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fi-FI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const fiFI: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Luo organisaatio',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const frFR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Créer l’organisation',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/he-IL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const heIL: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'צור ארגון',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hr-HR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const hrHR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'kreiraj organizaciju',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/hu-HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const huHU: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Szervezet létrehozása',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/id-ID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const idID: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Buat organisasi',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/is-IS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const isIS: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Stofna samtök',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/it-IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const itIT: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Crea organizzazione',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const jaJP: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: '組織を作成する',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ko-KR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const koKR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: '조직 만들기',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/mn-MN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const mnMN: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Байгуулга үүсгэх',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/nb-NO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const nbNO: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Opprett organisasjon',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/nl-BE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const nlBE: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Creëer organisatie',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/nl-NL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const nlNL: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Creëer organisatie',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/pl-PL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const plPL: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Utwórz organizację',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const ptBR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Criar organização',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/pt-PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const ptPT: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Criar organização',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ro-RO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const roRO: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Creați o organizație',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/ru-RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const ruRU: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Создать организацию',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/sk-SK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const skSK: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Vytvoriť organizáciu',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/sr-RS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const srRS: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Kreiraj organizaciju',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/sv-SE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const svSE: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Skapa organisation',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/th-TH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const thTH: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'สร้างองค์กร',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/tr-TR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const trTR: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Oluştur',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/uk-UA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const ukUA: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Створити організацію',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/vi-VN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const viVN: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: 'Tạo tổ chức',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const zhCN: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: '创建组织',
Expand Down
1 change: 1 addition & 0 deletions packages/localizations/src/zh-TW.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const zhTW: LocalizationResource = {
switchPlan: undefined,
switchToAnnual: undefined,
viewFeatures: undefined,
year: undefined,
},
createOrganization: {
formButtonSubmit: '創建組織',
Expand Down
2 changes: 2 additions & 0 deletions packages/types/src/commerce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export interface CommercePlanResource extends ClerkResource {
name: string;
amount: number;
amountFormatted: string;
annualAmount: number;
annualAmountFormatted: string;
annualMonthlyAmount: number;
annualMonthlyAmountFormatted: string;
currencySymbol: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/types/src/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ export interface CommercePlanJSON extends ClerkResourceJSON {
name: string;
amount: number;
amount_formatted: string;
annual_amount: number;
annual_amount_formatted: string;
annual_monthly_amount: number;
annual_monthly_amount_formatted: string;
currency_symbol: string;
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ type _LocalizationResource = {
membershipRole__guestMember: LocalizationValue;
commerce: {
month: LocalizationValue;
year: LocalizationValue;
free: LocalizationValue;
getStarted: LocalizationValue;
manage: LocalizationValue;
Expand Down