Route billing upgrade CTA to package shop
This commit is contained in:
@@ -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}
|
||||||
|
|||||||
@@ -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 />);
|
||||||
|
|||||||
Reference in New Issue
Block a user