mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-06 02:48:28 +00:00
fix(web): landing page no longer nested inside Layout header/footer
When pathname is '/', Layout now renders only the Outlet without its own header/footer chrome, so the landing page's self-contained layout displays correctly.
This commit is contained in:
parent
f7df348a5a
commit
56aeb424af
1 changed files with 11 additions and 1 deletions
|
|
@ -1,9 +1,19 @@
|
|||
import { Suspense } from 'react'
|
||||
import { Outlet, Link } from '@tanstack/react-router'
|
||||
import { Outlet, Link, useRouterState } from '@tanstack/react-router'
|
||||
import { useAuth } from '@/features/auth/use-auth'
|
||||
|
||||
export function Layout() {
|
||||
const { user, isLoading } = useAuth()
|
||||
const pathname = useRouterState({ select: (s) => s.location.pathname })
|
||||
const isLanding = pathname === '/'
|
||||
|
||||
if (isLanding) {
|
||||
return (
|
||||
<Suspense fallback={null}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background bg-dots relative">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue