Refine billing schema and enhance visuals of PricingTable

Removed redundant validation for 'lifetime' subscription plans in billing schema. Extensively updated the UI, layout and visuals of PricingTable component to offer a more user-friendly and aesthetically pleasing interface, improving overall user experience.
This commit is contained in:
giancarlo
2024-04-05 11:49:09 +08:00
parent 220a23e185
commit d64c620f69
2 changed files with 105 additions and 78 deletions

View File

@@ -104,21 +104,6 @@ export const PlanSchema = z
path: ['lineItems'],
},
)
.refine(
(data) => {
if (data.paymentType === 'one-time') {
const meteredItems = data.lineItems.filter(
(item) => item.type === 'metered',
);
return meteredItems.length === 0;
}
},
{
message: 'One-time plans must not have metered line items',
path: ['paymentType', 'lineItems'],
},
)
.refine(
(data) => {
if (data.paymentType === 'one-time') {
@@ -126,6 +111,8 @@ export const PlanSchema = z
return baseItems.length === 0;
}
return true;
},
{
message: 'One-time plans must not have non-base line items',