@@ -2,6 +2,7 @@ import AppAvatar from "@/components/avatar";
22import { Logo } from "@/components/logo" ;
33import { Button } from "@/components/ui/button" ;
44import useUser from "@/hooks/use-user" ;
5+ import { ENABLE_SOCIAL_PLATFORM , ENABLE_STATISTICS_PAGE } from "@/lib/features" ;
56import { cn } from "@/lib/utils" ;
67import { BarChart3 , BookOpen , ChevronDown , Menu , MessageSquare , Swords , X } from "lucide-react" ;
78import Link from "next/link" ;
@@ -171,11 +172,13 @@ interface ExternalNavItem extends BaseNavItem {
171172type NavItem = InternalNavItem | ExternalNavItem ;
172173
173174const navItems : NavItem [ ] = [
174- {
175- icon : < BarChart3 className = "h-full w-full" /> ,
176- label : "統計資料" ,
177- pathPrefix : "/statistics" ,
178- } ,
175+ ENABLE_STATISTICS_PAGE
176+ ? {
177+ icon : < BarChart3 className = "h-full w-full" /> ,
178+ label : "統計資料" ,
179+ pathPrefix : "/statistics" ,
180+ }
181+ : undefined ,
179182 {
180183 icon : < Swords className = "h-full w-full" /> ,
181184 label : "挑戰題目" ,
@@ -186,12 +189,14 @@ const navItems: NavItem[] = [
186189 label : "補充資料" ,
187190 pathPrefix : "/materials" ,
188191 } ,
189- {
190- icon : < MessageSquare className = "h-full w-full" /> ,
191- label : "意見分享" ,
192- externalLink : "https://community.dbplay.app/discord" ,
193- } ,
194- ] ;
192+ ENABLE_SOCIAL_PLATFORM
193+ ? {
194+ icon : < MessageSquare className = "h-full w-full" /> ,
195+ label : "意見分享" ,
196+ externalLink : "https://community.dbplay.app/discord" ,
197+ }
198+ : undefined ,
199+ ] . filter ( ( item ) => item !== undefined ) ;
195200
196201function getActiveNavItemLabel ( path : string ) : string | null {
197202 for ( const item of navItems ) {
0 commit comments