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} pkg={activePackage}
label={t('billing.sections.packages.card.statusActive', 'Aktiv')} label={t('billing.sections.packages.card.statusActive', 'Aktiv')}
isActive isActive
onOpenPortal={openPortal} onOpenShop={() => navigate(adminPath('/mobile/billing/shop'))}
portalBusy={portalBusy}
/> />
) : null} ) : null}
{packages {packages
@@ -492,14 +491,12 @@ function PackageCard({
pkg, pkg,
label, label,
isActive = false, isActive = false,
onOpenPortal, onOpenShop,
portalBusy,
}: { }: {
pkg: TenantPackageSummary; pkg: TenantPackageSummary;
label?: string; label?: string;
isActive?: boolean; isActive?: boolean;
onOpenPortal?: () => void; onOpenShop?: () => void;
portalBusy?: boolean;
}) { }) {
const { t } = useTranslation('management'); const { t } = useTranslation('management');
const { border, primary, accentSoft, textStrong, muted } = useAdminTheme(); const { border, primary, accentSoft, textStrong, muted } = useAdminTheme();
@@ -600,15 +597,14 @@ function PackageCard({
))} ))}
</YStack> </YStack>
) : null} ) : null}
{isActive && hasUsageWarning && onOpenPortal ? ( {isActive && hasUsageWarning ? (
<CTAButton <CTAButton
label={ label={
isDanger isDanger
? t('mobileBilling.usage.ctaDanger', 'Upgrade package') ? t('mobileBilling.usage.ctaDanger', 'Upgrade package')
: t('mobileBilling.usage.ctaWarning', 'Secure more capacity') : t('mobileBilling.usage.ctaWarning', 'Secure more capacity')
} }
onPress={onOpenPortal} onPress={onOpenShop}
disabled={portalBusy}
tone={isDanger ? 'danger' : 'primary'} tone={isDanger ? 'danger' : 'primary'}
/> />
) : null} ) : null}

View File

@@ -168,6 +168,7 @@ describe('MobileBrandingPage', () => {
getEventMock.mockResolvedValueOnce({ getEventMock.mockResolvedValueOnce({
...baseEvent, ...baseEvent,
package: { branding_allowed: false, watermark_allowed: false }, package: { branding_allowed: false, watermark_allowed: false },
settings: { branding_allowed: false, watermark_allowed: false },
}); });
render(<MobileBrandingPage />); render(<MobileBrandingPage />);
@@ -183,6 +184,7 @@ describe('MobileBrandingPage', () => {
getEventMock.mockResolvedValueOnce({ getEventMock.mockResolvedValueOnce({
...baseEvent, ...baseEvent,
package: { branding_allowed: true, watermark_allowed: false }, package: { branding_allowed: true, watermark_allowed: false },
settings: { branding_allowed: true, watermark_allowed: false },
}); });
render(<MobileBrandingPage />); render(<MobileBrandingPage />);