Route billing upgrade CTA to package shop
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-15 10:28:18 +01:00
parent 62255dc9e7
commit 2f93271d94
2 changed files with 7 additions and 9 deletions

View File

@@ -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}

View File

@@ -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 />);