From 7bf0b8bb63560efde6b615bf2761617f9947d882 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Fri, 20 Sep 2024 15:11:45 +0200 Subject: [PATCH] Simplify plans buttons behavior --- components/plans.tsx | 59 +++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/components/plans.tsx b/components/plans.tsx index 77f07617..aa8ed39f 100644 --- a/components/plans.tsx +++ b/components/plans.tsx @@ -176,43 +176,18 @@ const PlansView: FunctionComponent<{
- <> - {/* Hide trial if already subscribed */} - {(!currentUser.data || currentUser.data?.plan === 'FREE') && ( -
- {pricing[plan].trialDays} days free trial included -
- )} - + +
+ {pricing[plan].trialDays} days free trial included +
); const tickBadge = ( @@ -365,9 +340,13 @@ const PlansView: FunctionComponent<{ -
- {subscribeBtn(Plans.SOLO)} -
+ {/* show only if not connected or not already subscribed */} + {(!currentUser.data || + currentUser.data?.plan === 'FREE') && ( +
+ {subscribeBtn(Plans.SOLO)} +
+ )}
@@ -464,9 +443,15 @@ const PlansView: FunctionComponent<{ /{suffixes[planFrequency]}/seat
-
- {subscribeBtn(Plans.TEAM)} -
+ + {/* show only if not connected or not already subscribed */} + {(!currentUser.data || + currentUser.data?.plan === 'FREE') && ( +
+ {subscribeBtn(Plans.TEAM)} +
+ )} +