fix: landing page rendered unstyled - route bypassed (landing) layout
Root cause: app/page.tsx owned `/` and imported the landing component directly, so `/` only got the root layout. The (landing)/layout.tsx that supplies .landing-root, the IBM Plex Mono / Libre Baskerville fonts, and landing.css never ran, so the redesigned page (which is scoped under .landing-root) rendered with no styles at all. The old landing used global Tailwind tokens so the missing layout went unnoticed. Fix: the canonical App Router structure. `/` now resolves to app/(landing)/page.tsx (route groups add no path segment), wrapped by app/(landing)/layout.tsx. The logged-in -> /dashboard redirect moved into that page. Deleted the duplicate app/page.tsx. Build clean, no parallel-route conflict, `/` resolves. 266/266 tests pass.
This commit is contained in:
+10
-1
@@ -1,4 +1,6 @@
|
||||
import Link from 'next/link'
|
||||
import { redirect } from 'next/navigation'
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { BrandMark } from '@/components/brand-mark'
|
||||
import { GithubIcon, ArrowIcon } from '@/components/landing/icons'
|
||||
import { ResourceShowcase } from '@/components/landing/resource-showcase'
|
||||
@@ -19,7 +21,14 @@ const STEPS = [
|
||||
{ num: '03', title: 'Seed your ops docs', desc: 'Drop in SOPs, credentials, and area leads. The whole board has one place to look things up.' },
|
||||
]
|
||||
|
||||
export default function LandingPage() {
|
||||
export default async function LandingPage() {
|
||||
// `/` resolves here (route group adds no path segment), so this page is
|
||||
// wrapped by (landing)/layout.tsx which supplies the .landing-root theme,
|
||||
// fonts, and landing.css. Logged-in visitors skip the marketing page.
|
||||
const supabase = await createClient()
|
||||
const { data: { user } } = await supabase.auth.getUser()
|
||||
if (user) redirect('/dashboard')
|
||||
|
||||
return (
|
||||
<>
|
||||
<nav className="landing-nav">
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { createClient } from '@/lib/supabase/server'
|
||||
import { redirect } from 'next/navigation'
|
||||
import LandingPage from './(landing)/page'
|
||||
|
||||
export default async function RootPage() {
|
||||
const supabase = await createClient()
|
||||
const { data: { user } } = await supabase.auth.getUser()
|
||||
if (user) {
|
||||
redirect('/dashboard')
|
||||
}
|
||||
return <LandingPage />
|
||||
}
|
||||
Reference in New Issue
Block a user