Route billing upgrade CTA to package shop
This commit is contained in:
@@ -385,8 +385,7 @@ export default function MobileBillingPage() {
|
||||
pkg={activePackage}
|
||||
label={t('billing.sections.packages.card.statusActive', 'Aktiv')}
|
||||
isActive
|
||||
onOpenPortal={openPortal}
|
||||
portalBusy={portalBusy}
|
||||
onOpenShop={() => navigate(adminPath('/mobile/billing/shop'))}
|
||||
/>
|
||||
) : null}
|
||||
{packages
|
||||
@@ -492,14 +491,12 @@ function PackageCard({
|
||||
pkg,
|
||||
label,
|
||||
isActive = false,
|
||||
onOpenPortal,
|
||||
portalBusy,
|
||||
onOpenShop,
|
||||
}: {
|
||||
pkg: TenantPackageSummary;
|
||||
label?: string;
|
||||
isActive?: boolean;
|
||||
onOpenPortal?: () => void;
|
||||
portalBusy?: boolean;
|
||||
onOpenShop?: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation('management');
|
||||
const { border, primary, accentSoft, textStrong, muted } = useAdminTheme();
|
||||
@@ -600,15 +597,14 @@ function PackageCard({
|
||||
))}
|
||||
</YStack>
|
||||
) : null}
|
||||
{isActive && hasUsageWarning && onOpenPortal ? (
|
||||
{isActive && hasUsageWarning ? (
|
||||
<CTAButton
|
||||
label={
|
||||
isDanger
|
||||
? t('mobileBilling.usage.ctaDanger', 'Upgrade package')
|
||||
: t('mobileBilling.usage.ctaWarning', 'Secure more capacity')
|
||||
}
|
||||
onPress={onOpenPortal}
|
||||
disabled={portalBusy}
|
||||
onPress={onOpenShop}
|
||||
tone={isDanger ? 'danger' : 'primary'}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
@@ -168,6 +168,7 @@ describe('MobileBrandingPage', () => {
|
||||
getEventMock.mockResolvedValueOnce({
|
||||
...baseEvent,
|
||||
package: { branding_allowed: false, watermark_allowed: false },
|
||||
settings: { branding_allowed: false, watermark_allowed: false },
|
||||
});
|
||||
|
||||
render(<MobileBrandingPage />);
|
||||
@@ -183,6 +184,7 @@ describe('MobileBrandingPage', () => {
|
||||
getEventMock.mockResolvedValueOnce({
|
||||
...baseEvent,
|
||||
package: { branding_allowed: true, watermark_allowed: false },
|
||||
settings: { branding_allowed: true, watermark_allowed: false },
|
||||
});
|
||||
|
||||
render(<MobileBrandingPage />);
|
||||
|
||||
Reference in New Issue
Block a user