chore: support config for enable upgrade card
This commit is contained in:
parent
38bb93fa4f
commit
3ea18fcade
@ -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} />}
|
||||
|
@ -34,6 +34,7 @@ export const websiteConfig: WebsiteConfig = {
|
||||
},
|
||||
features: {
|
||||
enableDiscordWidget: true,
|
||||
enableUpgradeCard: true,
|
||||
},
|
||||
routes: {
|
||||
defaultLoginRedirect: '/dashboard',
|
||||
|
1
src/types/index.d.ts
vendored
1
src/types/index.d.ts
vendored
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user