Files
wzdj/old/components/layout/app-shell.tsx
2026-04-20 14:56:28 +08:00

26 lines
678 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"use client"
import { usePathname } from "next/navigation"
import { MobileNav } from "@/components/layout/mobile-nav"
/**
* 应用外壳C 端为移动端(窄屏 + 底部导航),管理后台 /admin 为纯 PC全宽、无底部导航
*/
export function AppShell({ children }: { children: React.ReactNode }) {
const pathname = usePathname()
const isAdmin = pathname?.startsWith("/admin")
if (isAdmin) {
return <>{children}</>
}
return (
<>
<main className="mx-auto w-full max-w-md min-h-screen bg-background relative shadow-2xl overflow-x-hidden overflow-y-auto pb-20">
{children}
</main>
<MobileNav />
</>
)
}