Skip to content

Commit a8e8ec6

Browse files
committed
update designs a lot
1 parent a7f8c22 commit a8e8ec6

File tree

946 files changed

+6300
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

946 files changed

+6300
-27
lines changed

exercises/02.linking/README.mdx

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "exercises_03.nested-routes_02.problem.nested-path",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"imports": {
7+
"#src/*": "./src/*"
8+
},
9+
"scripts": {
10+
"dev": "vite",
11+
"build": "tsc -b && vite build",
12+
"preview": "vite preview",
13+
"test": "playwright test --config=./tests/playwright.config.ts"
14+
},
15+
"dependencies": {
16+
"@tailwindcss/vite": "^4.0.9",
17+
"class-variance-authority": "^0.7.1",
18+
"clsx": "^2.1.1",
19+
"react": "^19.0.0",
20+
"react-dom": "^19.0.0",
21+
"react-router": "^7.2.0",
22+
"tailwindcss": "^4.0.9"
23+
},
24+
"devDependencies": {
25+
"@playwright/test": "^1.50.1",
26+
"@types/node": "^22.13.5",
27+
"@types/react": "^19.0.10",
28+
"@types/react-dom": "^19.0.4",
29+
"@vitejs/plugin-react": "^4.3.4",
30+
"typescript": "^5.7.3",
31+
"vite": "^6.2.0"
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import {
2+
createBrowserRouter,
3+
createRoutesFromElements,
4+
Route,
5+
} from 'react-router'
6+
import { AboutRoute } from './routes/app/marketing/about.tsx'
7+
import { HomepageRoute } from './routes/app/marketing/homepage.tsx'
8+
import { MarketingLayout } from './routes/app/marketing/layout.tsx'
9+
10+
export const router = createBrowserRouter(
11+
createRoutesFromElements(
12+
// 🐨 set the path for the MarketingLayout to "/"
13+
// 💯 play around with setting the path to "/app" and see how that affects things
14+
<Route element={<MarketingLayout />}>
15+
{/* 🐨 remove the path from the HomepageRoute and add the index prop */}
16+
<Route path="/" element={<HomepageRoute />} />
17+
{/* 🐨 remove the "/" from about to make it relative to the parent route */}
18+
<Route path="/about" element={<AboutRoute />} />
19+
</Route>,
20+
),
21+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { Link, Outlet } from 'react-router'
2+
import { ButtonLink } from '#src/components/button.tsx'
3+
4+
export function MarketingLayout() {
5+
return (
6+
<div className="bg-background flex h-screen flex-col">
7+
<header className="bg-background-alt px-4 py-3">
8+
<div className="container mx-auto flex max-w-6xl items-center justify-between">
9+
<Link
10+
to="/"
11+
className="text-foreground text-2xl font-bold hover:no-underline focus:no-underline"
12+
>
13+
gratitext
14+
</Link>
15+
<nav>
16+
<ButtonLink to="/recipients">Recipients</ButtonLink>
17+
</nav>
18+
</div>
19+
</header>
20+
21+
<div className="flex min-h-0 flex-1 flex-grow flex-col">
22+
<div className="flex h-full flex-grow flex-col">
23+
<main className="container mx-auto max-w-6xl flex-1 px-4 py-8">
24+
<Outlet />
25+
</main>
26+
27+
<footer className="bg-background-alt px-4 py-8">
28+
<div className="container mx-auto max-w-6xl">
29+
<div className="mb-8 flex items-center justify-between">
30+
<Link
31+
to="/"
32+
className="text-foreground-alt text-xl font-bold hover:no-underline focus:no-underline"
33+
>
34+
gratitext
35+
</Link>
36+
<nav className="flex gap-8">
37+
<Link to="/contact">Contact</Link>
38+
<Link to="/about">About</Link>
39+
</nav>
40+
</div>
41+
<div className="border-border flex items-center justify-between border-t pt-8 text-sm">
42+
<div>All Rights Reserved</div>
43+
<div className="flex gap-6">
44+
<Link to="/terms">Terms and Conditions</Link>
45+
<Link to="/privacy">Privacy Policy</Link>
46+
</div>
47+
</div>
48+
</div>
49+
</footer>
50+
</div>
51+
</div>
52+
</div>
53+
)
54+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "exercises_03.nested-routes_02.solution.nested-path",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"imports": {
7+
"#src/*": "./src/*"
8+
},
9+
"scripts": {
10+
"dev": "vite",
11+
"build": "tsc -b && vite build",
12+
"preview": "vite preview",
13+
"test": "playwright test --config=./tests/playwright.config.ts"
14+
},
15+
"dependencies": {
16+
"@tailwindcss/vite": "^4.0.9",
17+
"class-variance-authority": "^0.7.1",
18+
"clsx": "^2.1.1",
19+
"react": "^19.0.0",
20+
"react-dom": "^19.0.0",
21+
"react-router": "^7.2.0",
22+
"tailwindcss": "^4.0.9"
23+
},
24+
"devDependencies": {
25+
"@playwright/test": "^1.50.1",
26+
"@types/node": "^22.13.5",
27+
"@types/react": "^19.0.10",
28+
"@types/react-dom": "^19.0.4",
29+
"@vitejs/plugin-react": "^4.3.4",
30+
"typescript": "^5.7.3",
31+
"vite": "^6.2.0"
32+
}
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import {
2+
createBrowserRouter,
3+
createRoutesFromElements,
4+
Route,
5+
} from 'react-router'
6+
import { AboutRoute } from './routes/app/marketing/about.tsx'
7+
import { HomepageRoute } from './routes/app/marketing/homepage.tsx'
8+
import { MarketingLayout } from './routes/app/marketing/layout.tsx'
9+
10+
export const router = createBrowserRouter(
11+
createRoutesFromElements(
12+
<Route path="/" element={<MarketingLayout />}>
13+
<Route index element={<HomepageRoute />} />
14+
<Route path="about" element={<AboutRoute />} />
15+
</Route>,
16+
),
17+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { Link, Outlet } from 'react-router'
2+
import { ButtonLink } from '#src/components/button.tsx'
3+
4+
export function MarketingLayout() {
5+
return (
6+
<div className="bg-background flex h-screen flex-col">
7+
<header className="bg-background-alt px-4 py-3">
8+
<div className="container mx-auto flex max-w-6xl items-center justify-between">
9+
<Link
10+
to="/"
11+
className="text-foreground text-2xl font-bold hover:no-underline focus:no-underline"
12+
>
13+
gratitext
14+
</Link>
15+
<nav>
16+
<ButtonLink to="/recipients">Recipients</ButtonLink>
17+
</nav>
18+
</div>
19+
</header>
20+
21+
<div className="flex min-h-0 flex-1 flex-grow flex-col">
22+
<div className="flex h-full flex-grow flex-col">
23+
<main className="container mx-auto max-w-6xl flex-1 px-4 py-8">
24+
<Outlet />
25+
</main>
26+
27+
<footer className="bg-background-alt px-4 py-8">
28+
<div className="container mx-auto max-w-6xl">
29+
<div className="mb-8 flex items-center justify-between">
30+
<Link
31+
to="/"
32+
className="text-foreground-alt text-xl font-bold hover:no-underline focus:no-underline"
33+
>
34+
gratitext
35+
</Link>
36+
<nav className="flex gap-8">
37+
<Link to="/contact">Contact</Link>
38+
<Link to="/about">About</Link>
39+
</nav>
40+
</div>
41+
<div className="border-border flex items-center justify-between border-t pt-8 text-sm">
42+
<div>All Rights Reserved</div>
43+
<div className="flex gap-6">
44+
<Link to="/terms">Terms and Conditions</Link>
45+
<Link to="/privacy">Privacy Policy</Link>
46+
</div>
47+
</div>
48+
</div>
49+
</footer>
50+
</div>
51+
</div>
52+
</div>
53+
)
54+
}

exercises/03.nested-routes/02.problem.nested-layout/package.json renamed to exercises/03.nested-routes/03.problem.nested-layout/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "exercises_03.nested-routes_02.problem.nested-layout",
2+
"name": "exercises_03.nested-routes_03.problem.nested-layout",
33
"private": true,
44
"version": "0.0.0",
55
"type": "module",

0 commit comments

Comments
 (0)