Skip to content

Commit

Permalink
fix: Show cancel date only when active
Browse files Browse the repository at this point in the history
  • Loading branch information
amaury1093 committed Dec 12, 2023
1 parent 6b98514 commit 6148f5c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ export function Dashboard({ products }: DashboardProps): React.ReactElement {
<Text className="text-right" h3>
{productName(subscription?.prices?.products)}
</Text>
{subscription?.cancel_at && (
<Text p small em className="text-right mt-0">
⚠️ Plan ends on{" "}
{formatDate(new Date(subscription.cancel_at))}
</Text>
)}
{subscription?.status === "active" &&
subscription?.cancel_at && (
<Text p small em className="text-right mt-0">
⚠️ Plan ends on{" "}
{formatDate(new Date(subscription.cancel_at))}
</Text>
)}
<div className="text-right">
{subscription ? (
<StripeMananageButton>
Expand Down

1 comment on commit 6148f5c

@vercel
Copy link

@vercel vercel bot commented on 6148f5c Dec 12, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.