From 81f2cb4cbdf2ee0d4011a803a5b0fc0490deab3e Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 7 Nov 2022 18:15:51 +0800 Subject: [PATCH] Only show for non free projects --- .../DeleteProjectButton.tsx | 98 ++++++++++--------- .../components/ui/Modals/TextConfirmModal.tsx | 2 +- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx b/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx index 6bd489a0fd2..f5390b43b32 100644 --- a/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx +++ b/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx @@ -22,7 +22,7 @@ const DeleteProjectButton: FC = ({ type = 'danger' }) => { const project = ui.selectedProject const projectRef = project?.ref - const projectTier = project?.subscription_tier + const projectTier = project?.subscription_tier ?? PRICING_TIER_PRODUCT_IDS.FREE const isOwner = ui.selectedOrganization?.is_owner const isFree = projectTier === PRICING_TIER_PRODUCT_IDS.FREE @@ -144,52 +144,56 @@ const DeleteProjectButton: FC = ({ type = 'danger' }) => { in ExitSurvey has a Form wrapped around it already. Will probably need some effort to refactor but leaving that for the future. */} -
-

We're sad that you're leaving.

-

- We always strive to improve Supabase as much as we can. Please let us know the reasons - you are deleting your project so that we can improve in the future. -

-
-
-
- {CANCELLATION_REASONS.map((option) => { - const active = selectedReasons.find((x) => x === option) - return ( - - ) - })} -
-
- setCancellationMessage(event.target.value)} - /> -
-
+ {!isFree && ( + <> +
+

We're sad that you're leaving.

+

+ We always strive to improve Supabase as much as we can. Please let us know the + reasons you are deleting your project so that we can improve in the future. +

+
+
+
+ {CANCELLATION_REASONS.map((option) => { + const active = selectedReasons.find((x) => x === option) + return ( + + ) + })} +
+
+ setCancellationMessage(event.target.value)} + /> +
+
+ + )} ) diff --git a/studio/components/ui/Modals/TextConfirmModal.tsx b/studio/components/ui/Modals/TextConfirmModal.tsx index 5394761ff22..d6566b0a5ff 100644 --- a/studio/components/ui/Modals/TextConfirmModal.tsx +++ b/studio/components/ui/Modals/TextConfirmModal.tsx @@ -56,7 +56,7 @@ const TextConfirmModal: FC = ({ {() => (
- {children !== undefined && ( + {children && ( <> {children}