Update
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// resources/js/Pages/User/Partials/upgrade-sheet.jsx
|
||||
import { usePage } from '@inertiajs/react';
|
||||
|
||||
import { SparklesText } from '@/components/magicui/sparkles-text';
|
||||
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion';
|
||||
@@ -17,8 +16,7 @@ import UpgradePlanCarousel from './partials/upgrade-plan-carousel.tsx';
|
||||
|
||||
const UpgradeSheet = () => {
|
||||
const { subscription, one_times, isFetchingPricing, fetchPricing, isCheckingOut, checkoutSubscribe, checkoutPurchase } = usePricingStore();
|
||||
const { plan, billing, user_usage, credits, redirectBillingPortal, isRedirectingToBilling } = useUserStore();
|
||||
const { auth } = usePage().props;
|
||||
const { plan, billing, user_usage, credits, redirectBillingPortal, isRedirectingToBilling, user } = useUserStore();
|
||||
|
||||
// State to control sheet visibility
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
@@ -118,7 +116,7 @@ const UpgradeSheet = () => {
|
||||
</SheetHeader>
|
||||
|
||||
<div className="mx-auto w-full max-w-[600px] space-y-3 px-4">
|
||||
{auth?.user ? (
|
||||
{user ? (
|
||||
<div id="stats">
|
||||
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
||||
{/* Non-watermark Exports */}
|
||||
@@ -163,7 +161,7 @@ const UpgradeSheet = () => {
|
||||
|
||||
{subscription ? (
|
||||
<>
|
||||
{auth.user && plan.tier != 'free' ? (
|
||||
{user && plan.tier != 'free' ? (
|
||||
<div className="mx-auto space-y-6 rounded-lg border p-4 text-center sm:p-7">
|
||||
<SparklesText className="text-xl font-bold sm:text-xl">You're now in the {plan?.name} plan!</SparklesText>
|
||||
</div>
|
||||
@@ -268,7 +266,7 @@ const UpgradeSheet = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{!(auth.user && plan.tier != 'free') && (
|
||||
{!(user && plan.tier != 'free') && (
|
||||
<div id="faq" className="space-y-4 rounded-lg border p-4 sm:p-7">
|
||||
<div className="text-center text-xl font-extrabold sm:text-2xl">Frequently Asked Questions</div>
|
||||
<Accordion type="single" collapsible className="w-full" defaultValue="item-1">
|
||||
|
||||
Reference in New Issue
Block a user