feat: wip billing page

This commit is contained in:
Ahmed Bouhuolia
2024-07-28 17:53:51 +02:00
parent 14a9c4ba28
commit 1660df20af
14 changed files with 488 additions and 69 deletions

View File

@@ -29,6 +29,7 @@ interface SubscriptionPricingProps {
annuallyPriceLabel: string;
monthlyVariantId?: string;
annuallyVariantId?: string;
onSubscribe?: (variantId: number) => void;
}
interface SubscriptionPricingCombinedProps
@@ -46,6 +47,7 @@ function SubscriptionPlanRoot({
annuallyPriceLabel,
monthlyVariantId,
annuallyVariantId,
onSubscribe,
// #withPlans
plansPeriod,
@@ -59,17 +61,19 @@ function SubscriptionPlanRoot({
? monthlyVariantId
: annuallyVariantId;
getLemonCheckout({ variantId })
.then((res) => {
const checkoutUrl = res.data.data.attributes.url;
window.LemonSqueezy.Url.Open(checkoutUrl);
})
.catch(() => {
AppToaster.show({
message: 'Something went wrong!',
intent: Intent.DANGER,
});
});
onSubscribe && onSubscribe(variantId);
// getLemonCheckout({ variantId })
// .then((res) => {
// const checkoutUrl = res.data.data.attributes.url;
// window.LemonSqueezy.Url.Open(checkoutUrl);
// })
// .catch(() => {
// AppToaster.show({
// message: 'Something went wrong!',
// intent: Intent.DANGER,
// });
// });
};
return (