don't show purchase modal if user is already a subscriber
This commit is contained in:
parent
c7482be855
commit
a165df2735
@ -22,6 +22,7 @@ const PricingDialog: React.FC = () => {
|
|||||||
const [paymentInterval, setPaymentInterval] = React.useState<
|
const [paymentInterval, setPaymentInterval] = React.useState<
|
||||||
"monthly" | "yearly"
|
"monthly" | "yearly"
|
||||||
>("monthly");
|
>("monthly");
|
||||||
|
const subscriberTier = useStore((state) => state.subscriberTier);
|
||||||
const [showDialog, setShowDialog] = useStore((state) => [
|
const [showDialog, setShowDialog] = useStore((state) => [
|
||||||
state.isPricingDialogOpen,
|
state.isPricingDialogOpen,
|
||||||
state.setPricingDialogOpen,
|
state.setPricingDialogOpen,
|
||||||
@ -29,12 +30,14 @@ const PricingDialog: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={showDialog} onOpenChange={(isOpen) => setShowDialog(isOpen)}>
|
<Dialog open={showDialog} onOpenChange={(isOpen) => setShowDialog(isOpen)}>
|
||||||
<DialogTrigger
|
{subscriberTier === "free" && (
|
||||||
className="fixed z-50 bottom-28 right-5 rounded-md shadow-lg bg-black
|
<DialogTrigger
|
||||||
|
className="fixed z-50 bottom-28 right-5 rounded-md shadow-lg bg-black
|
||||||
text-white px-4 text-xs py-3 cursor-pointer"
|
text-white px-4 text-xs py-3 cursor-pointer"
|
||||||
>
|
>
|
||||||
get 100 code generations for $15
|
get 100 code generations for $15
|
||||||
</DialogTrigger>
|
</DialogTrigger>
|
||||||
|
)}
|
||||||
<DialogContent className="max-w-2xl">
|
<DialogContent className="max-w-2xl">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle className="mb-2 text-2xl text-center">
|
<DialogTitle className="mb-2 text-2xl text-center">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user