Only show for non free projects

This commit is contained in:
Joshen Lim committed 2022-11-10 13:54:03 +08:00
1 parent b6fab99551
commit 81f2cb4cbd
2 files changed
+52 -48

No files matched your search

@@ -22,7 +22,7 @@ const DeleteProjectButton: FC<Props> = ({ type = 'danger' }) => {
const project = ui.selectedProject const project = ui.selectedProject
const projectRef = project?.ref 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 isOwner = ui.selectedOrganization?.is_owner
const isFree = projectTier === PRICING_TIER_PRODUCT_IDS.FREE const isFree = projectTier === PRICING_TIER_PRODUCT_IDS.FREE
@@ -144,52 +144,56 @@ const DeleteProjectButton: FC<Props> = ({ type = 'danger' }) => {
in ExitSurvey has a Form wrapped around it already. Will probably need some effort to refactor in ExitSurvey has a Form wrapped around it already. Will probably need some effort to refactor
but leaving that for the future. but leaving that for the future.
*/} */}
<div className="space-y-1"> {!isFree && (
<h4 className="text-base">We're sad that you're leaving.</h4> <>
<p className="text-sm text-scale-1100"> <div className="space-y-1">
We always strive to improve Supabase as much as we can. Please let us know the reasons <h4 className="text-base">We're sad that you're leaving.</h4>
you are deleting your project so that we can improve in the future. <p className="text-sm text-scale-1100">
</p> We always strive to improve Supabase as much as we can. Please let us know the
</div> reasons you are deleting your project so that we can improve in the future.
<div className="space-y-4 pt-4"> </p>
<div className="flex flex-wrap gap-2" data-toggle="buttons"> </div>
{CANCELLATION_REASONS.map((option) => { <div className="space-y-4 pt-4">
const active = selectedReasons.find((x) => x === option) <div className="flex flex-wrap gap-2" data-toggle="buttons">
return ( {CANCELLATION_REASONS.map((option) => {
<label const active = selectedReasons.find((x) => x === option)
key={option} return (
className={[ <label
'flex cursor-pointer items-center space-x-2 rounded-md py-1', key={option}
'pl-2 pr-3 text-center text-sm shadow-sm transition-all duration-100', className={[
`${ 'flex cursor-pointer items-center space-x-2 rounded-md py-1',
active 'pl-2 pr-3 text-center text-sm shadow-sm transition-all duration-100',
? ` bg-scale-1200 text-scale-100 opacity-100 hover:bg-opacity-75` `${
: ` bg-scale-700 text-scale-1200 opacity-25 hover:opacity-50` active
}`, ? ` bg-scale-1200 text-scale-100 opacity-100 hover:bg-opacity-75`
].join(' ')} : ` bg-scale-700 text-scale-1200 opacity-25 hover:opacity-50`
> }`,
<input ].join(' ')}
type="checkbox" >
name="options" <input
value={option} type="checkbox"
className="hidden" name="options"
onClick={(event: any) => onSelectCancellationReason(event.target.value)} value={option}
/> className="hidden"
<div>{option}</div> onClick={(event: any) => onSelectCancellationReason(event.target.value)}
</label> />
) <div>{option}</div>
})} </label>
</div> )
<div className="text-area-text-sm"> })}
<Input.TextArea </div>
name="message" <div className="text-area-text-sm">
label="Anything else that we can improve on?" <Input.TextArea
rows={3} name="message"
value={cancellationMessage} label="Anything else that we can improve on?"
onChange={(event) => setCancellationMessage(event.target.value)} rows={3}
/> value={cancellationMessage}
</div> onChange={(event) => setCancellationMessage(event.target.value)}
</div> />
</div>
</div>
</>
)}
</TextConfirmModal> </TextConfirmModal>
</> </>
) )
@@ -56,7 +56,7 @@ const TextConfirmModal: FC<Props> = ({
{() => ( {() => (
<div className="w-full py-4"> <div className="w-full py-4">
<div className="space-y-4"> <div className="space-y-4">
{children !== undefined && ( {children && (
<> <>
<Modal.Content>{children}</Modal.Content> <Modal.Content>{children}</Modal.Content>
<Modal.Separator /> <Modal.Separator />