主要更新: - 更新代理商端文档,明确项目由品牌方分配流程 - 新增Brief配置详情页(已配置)设计稿 - 完善工作台紧急待办中品牌新任务功能 - 整理Pencil设计文件中代理商端页面顺序 - 新增后端FastAPI框架及核心API - 新增前端Next.js页面和组件库 - 添加.gitignore排除构建和缓存文件 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
968 B
TypeScript
46 lines
968 B
TypeScript
'use client'
|
|
|
|
import { useEffect, useState } from 'react'
|
|
import { MobileLayout } from './MobileLayout'
|
|
import { DesktopLayout } from './DesktopLayout'
|
|
|
|
interface ResponsiveLayoutProps {
|
|
children: React.ReactNode
|
|
role?: 'creator' | 'agency' | 'brand'
|
|
showBottomNav?: boolean
|
|
}
|
|
|
|
export function ResponsiveLayout({
|
|
children,
|
|
role = 'creator',
|
|
showBottomNav = true,
|
|
}: ResponsiveLayoutProps) {
|
|
const [isMobile, setIsMobile] = useState(true)
|
|
|
|
useEffect(() => {
|
|
const checkMobile = () => {
|
|
setIsMobile(window.innerWidth < 1024)
|
|
}
|
|
|
|
checkMobile()
|
|
window.addEventListener('resize', checkMobile)
|
|
return () => window.removeEventListener('resize', checkMobile)
|
|
}, [])
|
|
|
|
if (isMobile) {
|
|
return (
|
|
<MobileLayout role={role} showBottomNav={showBottomNav}>
|
|
{children}
|
|
</MobileLayout>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<DesktopLayout role={role}>
|
|
{children}
|
|
</DesktopLayout>
|
|
)
|
|
}
|
|
|
|
export default ResponsiveLayout
|