Skip to content

Commit

Permalink
🐛Fix duplicate billing controls
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella committed Nov 6, 2023
1 parent 95feb9f commit cbe7caf
Showing 1 changed file with 0 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,101 +111,6 @@ const LegacyBilling = () => {
}}
/>
) : null}
<div className="grid gap-4 p-4 sm:grid-cols-2">
<div>
<Label>
<Trans i18nKey="billingStatusState" defaults="Status" />
</Label>
<div>
{(() => {
switch (status) {
case "active":
return (
<Trans i18nKey="billingStatusActive" defaults="Active" />
);
case "paused":
return (
<Trans i18nKey="billingStatusPaused" defaults="Paused" />
);
case "deleted":
return (
<Trans
i18nKey="billingStatusDeleted"
defaults="Cancelled"
/>
);
}
})()}
</div>
</div>
<div>
{status === "deleted" ? (
<Label>
<Trans i18nKey="endDate" defaults="End date" />
</Label>
) : (
<Label>
<Trans i18nKey="dueDate" defaults="Due date" />
</Label>
)}
<div>{dayjs(endDate).format("LL")}</div>
</div>
<div>
<Label>
<Trans i18nKey="billingStatusPlan" defaults="Plan" />
</Label>
<div>
<Trans i18nKey="planPro" />
</div>
</div>
<div>
<Label>
<Trans i18nKey="billingPeriod" defaults="Period" />
</Label>
<div>
{planId === proPlanIdMonthly ? (
<Trans i18nKey="billingPeriodMonthly" defaults="Monthly" />
) : (
<Trans i18nKey="billingPeriodYearly" defaults="Yearly" />
)}
</div>
</div>
</div>
{status === "active" || status === "paused" ? (
<div className="flex items-center gap-x-2 border-t bg-gray-50 p-3">
<Button
asChild
onClick={(e) => {
e.preventDefault();
window.Paddle.Checkout.open({
override: userPaymentData.updateUrl,
});
}}
>
<Link href={userPaymentData.updateUrl}>
<CreditCardIcon className="h-4 w-4" />
<Trans
i18nKey="subscriptionUpdatePayment"
defaults="Update Payment Details"
/>
</Link>
</Button>
<Button
asChild
variant="destructive"
onClick={(e) => {
e.preventDefault();
window.Paddle.Checkout.open({
override: userPaymentData.cancelUrl,
});
}}
>
<Link href={userPaymentData.cancelUrl}>
<Trans i18nKey="subscriptionCancel" defaults="Cancel" />
</Link>
</Button>
</div>
) : null}
<Card>
<div className="grid gap-4 p-4 sm:grid-cols-2">
<div>
Expand Down

1 comment on commit cbe7caf

@vercel
Copy link

@vercel vercel bot commented on cbe7caf Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

app – ./

app-rallly.vercel.app
app.rallly.co
app-git-main-rallly.vercel.app
rallly-vert.vercel.app

Please sign in to comment.