|
| 1 | +/// <reference types="vite/client" /> |
| 2 | +import { ClientOnly, Link, Outlet, linkOptions } from '@tanstack/solid-router' |
| 3 | +import styles from '~/styles/root-shell.module.css' |
| 4 | + |
| 5 | +const ROUTES = linkOptions([ |
| 6 | + { to: '/', label: 'home' }, |
| 7 | + { to: '/a', label: '/a' }, |
| 8 | + { to: '/b', label: '/b' }, |
| 9 | + { to: '/lazy-css-static', label: '/lazy-css-static' }, |
| 10 | + { to: '/lazy-css-lazy', label: '/lazy-css-lazy' }, |
| 11 | + { to: '/r1', label: '/r1' }, |
| 12 | + { to: '/r2', label: '/r2' }, |
| 13 | + { to: '/shared-a', label: '/shared-a' }, |
| 14 | +]) |
| 15 | + |
| 16 | +export function AppShell() { |
| 17 | + return ( |
| 18 | + <div class={styles.shell}> |
| 19 | + <nav class={styles.nav}> |
| 20 | + {ROUTES.map((route) => ( |
| 21 | + <Link {...route} data-testid={`nav-${route.label}`}> |
| 22 | + {route.label} |
| 23 | + </Link> |
| 24 | + ))} |
| 25 | + </nav> |
| 26 | + |
| 27 | + <main class={styles.content}> |
| 28 | + <div class={styles.rootBadge} data-testid="root-shell-marker"> |
| 29 | + Start manifest CSS root shell |
| 30 | + </div> |
| 31 | + <ClientOnly> |
| 32 | + <div data-testid="hydration-marker">hydrated</div> |
| 33 | + </ClientOnly> |
| 34 | + <Outlet /> |
| 35 | + </main> |
| 36 | + </div> |
| 37 | + ) |
| 38 | +} |
0 commit comments