File tree Expand file tree Collapse file tree 3 files changed +63
-1
lines changed
Expand file tree Collapse file tree 3 files changed +63
-1
lines changed Original file line number Diff line number Diff line change 1+
2+ import { Link , NavLink } from 'react-router' ;
3+
4+
5+ export default function Header ( ) {
6+
7+ const linkClassName = ( isActive : boolean ) => `
8+ h-[42px] items-center px-4 py-2 rounded-md text-black font-semibold
9+ ${ isActive ? 'bg-gray-200' : 'hover:bg-gray-200 transition-all' }
10+ ` ;
11+
12+ return (
13+ < header className = "sticky top-0 z-[100] flex w-full justify-center bg-gray-50 border" >
14+ < div className = "flex w-full items-center justify-between px-6 py-4 sm:w-screen-sm md:w-screen-md lg:w-screen-lg xl:max-w-screen-xl" >
15+ < Link to = "/" className = "text-xl font-bold font-title" >
16+ ๋ชจ์ด์ค
17+ </ Link >
18+ < div className = "items-center space-x-2" >
19+
20+ < NavLink
21+ to = "/login"
22+ className = { ( { isActive } ) => linkClassName ( isActive ) }
23+ >
24+ ๋ก๊ทธ์ธ
25+ </ NavLink >
26+ < NavLink
27+ to = "/register"
28+ className = { ( { isActive } ) => linkClassName ( isActive ) }
29+ >
30+ ํ์๊ฐ์
31+ </ NavLink >
32+
33+ </ div >
34+ </ div >
35+ </ header >
36+ ) ;
37+ }
Original file line number Diff line number Diff line change 1+ import { Outlet } from 'react-router' ;
2+ import { Toaster } from 'sonner' ;
3+ import Header2 from '@/components/Header2' ;
4+
5+ export default function RootLayout ( ) {
6+ return (
7+ < div className = "flex flex-col min-h-screen" >
8+ < Header2 />
9+ < main
10+ className = "flex w-full flex-1 flex-col bg-white px-3 xs:px-0"
11+ style = { { padding : '2rem' } }
12+ >
13+ < Outlet />
14+ </ main >
15+ < Toaster position = "bottom-center" richColors />
16+ </ div >
17+ ) ;
18+ }
Original file line number Diff line number Diff line change @@ -12,16 +12,23 @@ import NewEvent from './routes/NewEvent';
1212import RegisterChoice from './routes/RegisterChoice' ;
1313import RegisterForm from './routes/RegisterForm' ;
1414import SocialCallback from './routes/SocialCallback' ;
15+ import RootLayout2 from './layouts/RootLayout2' ;
1516
1617export const router = createBrowserRouter ( [
1718 {
1819 path : '/' ,
19- Component : RootLayout ,
20+ Component : RootLayout2 ,
2021 children : [
2122 { index : true , Component : Home } ,
2223 { path : 'login' , Component : Login } ,
2324 { path : 'register' , Component : RegisterChoice } ,
2425 { path : 'register/email' , Component : RegisterForm } ,
26+ ] ,
27+ } ,
28+ {
29+ path : '/' ,
30+ Component : RootLayout ,
31+ children : [
2532 { path : 'new-event' , Component : NewEvent } ,
2633 { path : 'auth/callback/:provider' , Component : SocialCallback } ,
2734 { path : 'test-main' , Component : Dashboard } , // ํ
์คํธ์ฉ ๋ฉ์ธ ํ์ด์ง ๋ผ์ฐํธ
You canโt perform that action at this time.
0 commit comments