chore: optimize upgrade card config
This commit is contained in:
parent
e27a7a081c
commit
1a4917c874
@ -77,9 +77,7 @@ export function DashboardSidebar({
|
||||
{!isPending && mounted && (
|
||||
<>
|
||||
{/* show upgrade card if user is not a member, and sidebar is not collapsed */}
|
||||
{currentUser &&
|
||||
state !== 'collapsed' &&
|
||||
websiteConfig.features.enableUpgradeCard && <UpgradeCard />}
|
||||
{currentUser && state !== 'collapsed' && <UpgradeCard />}
|
||||
|
||||
{/* show user profile if user is logged in */}
|
||||
{currentUser && <SidebarUser user={currentUser} />}
|
||||
|
@ -8,6 +8,7 @@ import {
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from '@/components/ui/card';
|
||||
import { websiteConfig } from '@/config/website';
|
||||
import { usePayment } from '@/hooks/use-payment';
|
||||
import { LocaleLink } from '@/i18n/navigation';
|
||||
import { Routes } from '@/routes';
|
||||
@ -16,6 +17,10 @@ import { useTranslations } from 'next-intl';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
export function UpgradeCard() {
|
||||
if (!websiteConfig.features.enableUpgradeCard) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const t = useTranslations('Dashboard.upgrade');
|
||||
const [mounted, setMounted] = useState(false);
|
||||
const { isLoading, currentPlan, subscription } = usePayment();
|
||||
|
Loading…
Reference in New Issue
Block a user