0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

fix(console): fix app creation modal footer

This commit is contained in:
Darcy Ye 2024-10-22 00:20:34 +08:00
parent 3022d2eba1
commit 1488665499
No known key found for this signature in database
GPG key ID: B46F4C07EDEFC610

View file

@ -42,9 +42,9 @@ function Footer({ selectedType, isLoading, onClickCreate, isThirdParty }: Props)
} = useUserPreferences(); } = useUserPreferences();
if (selectedType) { if (selectedType) {
if (selectedType === ApplicationType.MachineToMachine) {
if (hasMachineToMachineAppsReachedLimit) {
if ( if (
selectedType === ApplicationType.MachineToMachine &&
hasMachineToMachineAppsReachedLimit &&
// Just in case the enterprise plan has reached the resource limit, we still need to show charge notice. // Just in case the enterprise plan has reached the resource limit, we still need to show charge notice.
isPaidPlan(planId, isEnterprisePlan) && isPaidPlan(planId, isEnterprisePlan) &&
!m2mUpsellNoticeAcknowledged !m2mUpsellNoticeAcknowledged
@ -72,12 +72,8 @@ function Footer({ selectedType, isLoading, onClickCreate, isThirdParty }: Props)
); );
} }
if (
selectedType === ApplicationType.MachineToMachine &&
hasMachineToMachineAppsReachedLimit &&
// For paid plan (pro plan), we don't guard the m2m app creation since it's an add-on feature. // For paid plan (pro plan), we don't guard the m2m app creation since it's an add-on feature.
currentSku.id === ReservedPlanId.Free if (currentSku.id === ReservedPlanId.Free) {
) {
return ( return (
<QuotaGuardFooter> <QuotaGuardFooter>
<Trans <Trans
@ -90,7 +86,8 @@ function Footer({ selectedType, isLoading, onClickCreate, isThirdParty }: Props)
</QuotaGuardFooter> </QuotaGuardFooter>
); );
} }
}
} else {
// Third party app is only available for paid plan (pro plan). // Third party app is only available for paid plan (pro plan).
if (isThirdParty && hasThirdPartyAppsReachedLimit) { if (isThirdParty && hasThirdPartyAppsReachedLimit) {
return ( return (
@ -115,12 +112,15 @@ function Footer({ selectedType, isLoading, onClickCreate, isThirdParty }: Props)
planName: <SkuName skuId={planId} isEnterprisePlan={isEnterprisePlan} />, planName: <SkuName skuId={planId} isEnterprisePlan={isEnterprisePlan} />,
}} }}
> >
{t('paywall.applications', { count: currentSubscriptionQuota.applicationsLimit ?? 0 })} {t('paywall.applications', {
count: currentSubscriptionQuota.applicationsLimit ?? 0,
})}
</Trans> </Trans>
</QuotaGuardFooter> </QuotaGuardFooter>
); );
} }
} }
}
return ( return (
<Button <Button