let user know when his cancelled sub is going to expire

This commit is contained in:
m5r
2021-10-03 20:56:31 +02:00
parent 5f3060c591
commit a28d89a8c2
7 changed files with 40 additions and 25 deletions

View File

@ -24,7 +24,8 @@ const Billing: BlitzPage<Props> = (props) => {
TODO: I want to be able to
- upgrade to yearly
- downgrade to monthly
- resubscribe (after pause/cancel for example) (message like "your subscription expired, would you like to renew ?")
- know how much time I have left until my cancelled subscription runs out --- DONE
- resubscribe (message like "your subscription expired, would you like to renew ?")
*/
useRequireOnboarding();
@ -37,16 +38,24 @@ const Billing: BlitzPage<Props> = (props) => {
<>
{subscription ? (
<SettingsSection>
<p>Current plan: {subscription.paddlePlanId}</p>
<PaddleLink
onClick={() => updatePaymentMethod({ updateUrl: subscription.updateUrl })}
text="Update payment method"
/>
<PaddleLink
onClick={() => cancelSubscription({ cancelUrl: subscription.cancelUrl })}
text="Cancel subscription"
/>
{subscription.status === SubscriptionStatus.deleted ? (
<p>
Your {subscription.paddlePlanId} subscription is cancelled and will expire on{" "}
{subscription.cancellationEffectiveDate!.toLocaleDateString()}.
</p>
) : (
<>
<p>Current plan: {subscription.paddlePlanId}</p>
<PaddleLink
onClick={() => updatePaymentMethod({ updateUrl: subscription.updateUrl })}
text="Update payment method"
/>
<PaddleLink
onClick={() => cancelSubscription({ cancelUrl: subscription.cancelUrl })}
text="Cancel subscription"
/>
</>
)}
</SettingsSection>
) : null}