cancel subscription on account deletion

This commit is contained in:
m5r
2021-10-01 20:07:00 +02:00
parent c5f135fdcc
commit 188c028667
6 changed files with 33 additions and 3 deletions

View File

@ -53,7 +53,7 @@ export default function BillingHistory() {
{payment.amount} {payment.currency}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{payment.is_paid === 1 ? "Paid" : "Not paid yet"}
{payment.is_paid === 1 ? "Paid" : "Upcoming"}
</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
{typeof payment.receipt_url !== "undefined" ? (

View File

@ -10,7 +10,10 @@ export default function Plans() {
return (
<div className="mt-6 flex flex-row-reverse flex-wrap-reverse gap-x-4">
{pricing.tiers.map((tier) => {
const isCurrentTier = subscription?.paddlePlanId === tier.planId;
const isCurrentTier =
!subscription?.paddlePlanId && tier.planId === "free"
? true
: subscription?.paddlePlanId === tier.planId;
const cta = isCurrentTier ? "Current plan" : !!subscription ? `Switch to ${tier.title}` : "Subscribe";
return (