phase 2
This commit is contained in:
@@ -1,31 +1,31 @@
|
||||
import { createRootRoute, Link, Outlet } from "@tanstack/react-router"
|
||||
import { createRootRoute, Outlet } from '@tanstack/react-router'
|
||||
import { useEffect } from 'react'
|
||||
import { Sidebar } from '@/components/Sidebar'
|
||||
import { AppHeader } from '@/components/AppHeader'
|
||||
import { MobileNav } from '@/components/MobileNav'
|
||||
import { AuthModal } from '@/components/auth/AuthModal'
|
||||
import { useAuthStore } from '@/store/auth-store'
|
||||
|
||||
export const Route = createRootRoute({
|
||||
component: RootLayout,
|
||||
})
|
||||
|
||||
function RootLayout() {
|
||||
const initialize = useAuthStore((s) => s.initialize)
|
||||
|
||||
useEffect(() => {
|
||||
initialize()
|
||||
}, [initialize])
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-white text-gray-900">
|
||||
<header className="border-b px-4 py-3">
|
||||
<nav className="mx-auto max-w-5xl flex items-center gap-6">
|
||||
<Link to="/" className="text-lg font-bold">
|
||||
English App
|
||||
</Link>
|
||||
<Link to="/toeic" className="text-sm text-gray-600 hover:text-gray-900">
|
||||
Luyện đề
|
||||
</Link>
|
||||
<Link to="/writing" className="text-sm text-gray-600 hover:text-gray-900">
|
||||
Writing
|
||||
</Link>
|
||||
<Link to="/vocab" className="text-sm text-gray-600 hover:text-gray-900">
|
||||
Từ vựng
|
||||
</Link>
|
||||
</nav>
|
||||
</header>
|
||||
<main className="mx-auto max-w-5xl px-4 py-6">
|
||||
<div className="min-h-screen bg-slate-50">
|
||||
<Sidebar />
|
||||
<AppHeader />
|
||||
<main className="lg:ml-60 pt-16 pb-20 lg:pb-0 min-h-screen">
|
||||
<Outlet />
|
||||
</main>
|
||||
<MobileNav />
|
||||
<AuthModal />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
6
src/routes/auth.login.tsx
Normal file
6
src/routes/auth.login.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { LoginPage } from '@/pages/Login'
|
||||
|
||||
export const Route = createFileRoute('/auth/login')({
|
||||
component: LoginPage,
|
||||
})
|
||||
6
src/routes/auth.register.tsx
Normal file
6
src/routes/auth.register.tsx
Normal file
@@ -0,0 +1,6 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { RegisterPage } from '@/pages/Register'
|
||||
|
||||
export const Route = createFileRoute('/auth/register')({
|
||||
component: RegisterPage,
|
||||
})
|
||||
Reference in New Issue
Block a user