chore: support config for enable upgrade card

This commit is contained in:
javayhu 2025-05-27 23:47:05 +08:00
parent 38bb93fa4f
commit 3ea18fcade
3 changed files with 6 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import {
useSidebar,
} from '@/components/ui/sidebar';
import { getSidebarLinks } from '@/config/sidebar-config';
import { websiteConfig } from '@/config/website';
import { LocaleLink } from '@/i18n/navigation';
import { authClient } from '@/lib/auth-client';
import { Routes } from '@/routes';
@ -76,7 +77,9 @@ export function DashboardSidebar({
{!isPending && mounted && (
<>
{/* show upgrade card if user is not a member, and sidebar is not collapsed */}
{currentUser && state !== 'collapsed' && <UpgradeCard />}
{currentUser &&
state !== 'collapsed' &&
websiteConfig.features.enableUpgradeCard && <UpgradeCard />}
{/* show user profile if user is logged in */}
{currentUser && <SidebarUser user={currentUser} />}

View File

@ -34,6 +34,7 @@ export const websiteConfig: WebsiteConfig = {
},
features: {
enableDiscordWidget: true,
enableUpgradeCard: true,
},
routes: {
defaultLoginRedirect: '/dashboard',

View File

@ -66,6 +66,7 @@ export interface SocialConfig {
*/
export interface FeaturesConfig {
enableDiscordWidget?: boolean; // Whether to enable the discord widget
enableUpgradeCard?: boolean; // Whether to enable the upgrade card in the sidebar
}
/**