import { BackButton } from './BackButton'; import MobileBottomNav from './MobileBottomNav'; import MobileHeader from './MobileHeader'; import Sidebar from './Sidebar'; import { ThemeToggle } from './ThemeToggle'; import { UpdateNotification } from './UpdateNotification'; import { UserMenu } from './UserMenu'; import { VersionCheckProvider } from './VersionCheckProvider'; interface PageLayoutProps { children: React.ReactNode; activePath?: string; hideNavigation?: boolean; // 控制是否隐藏顶部和底部导航栏 } const PageLayout = ({ children, activePath = '/', hideNavigation = false }: PageLayoutProps) => { return (
{/* 移动端头部 */} {!hideNavigation && ( )} {/* 主要布局容器 */}
{/* 侧边栏 - 桌面端显示,移动端隐藏 */} {!hideNavigation && (
)} {/* 主内容区域 */}
{/* 桌面端左上角返回按钮 */} {!hideNavigation && ['/play', '/live'].includes(activePath) && (
)} {/* 桌面端顶部按钮 */} {!hideNavigation && (
)} {/* 主内容 */}
{children}
{/* 移动端底部导航 */} {!hideNavigation && (
)}
); }; export default PageLayout;