Open History to see the last commit
1import {
2 HeadContent,
3 Link,
4 Outlet,
5 Scripts,
6 createRootRoute,
7} from '@tanstack/react-router'
8β
9export const Route = createRootRoute({
10 head: () => ({
11 meta: [
12 { charSet: 'utf-8' },
13 { name: 'viewport', content: 'width=device-width, initial-scale=1' },
14 ],
15 }),
16 component: RootComponent,
17})
18β
19function RootComponent() {
20 return (
21 <html>
22 <head>
23 <HeadContent />
24 </head>
25 <body>
26 <nav
27 data-testid="main-nav"
28 style={{
29 padding: '12px 20px',
30 borderBottom: '1px solid #e2e8f0',
31 display: 'flex',
32 alignItems: 'center',
33 gap: '16px',
34 backgroundColor: '#fff',
35 }}
36 >
37 <Link
38 to="/"
39 style={{ color: '#0284c7', textDecoration: 'none' }}
40 data-testid="nav-home"
41 >
42 Home (Global CSS)
43 </Link>
44 <Link
45 to="/modules"
46 style={{ color: '#0284c7', textDecoration: 'none' }}
47 data-testid="nav-modules"
48 >
49 CSS Modules
50 </Link>
51 <Link
52 to="/sass-mixin"
53 style={{ color: '#0284c7', textDecoration: 'none' }}
54 data-testid="nav-sass-mixin"
55 >
56 Sass Mixin
57 </Link>
58 <Link
59 to="/quotes"
60 style={{ color: '#0284c7', textDecoration: 'none' }}
61 data-testid="nav-quotes"
62 >
63 Quoted CSS
64 </Link>
65 </nav>
66β
67 <main style={{ padding: '20px' }}>
68 <Outlet />
69 </main>
70 <Scripts />
71 </body>
72 </html>
73 )
74}