Skip to content

Commit d6c45c1

Browse files
committed
feedback updates
1 parent e82bb3b commit d6c45c1

File tree

6 files changed

+84
-7
lines changed

6 files changed

+84
-7
lines changed

exercises/03.data-fetching/01.solution.fetching-with-loaders/README.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ Prisma and SQLite, which is a great skill to have when building real-world appli
1010

1111
Now that you fully understand loaders and how to use them effectively, let's
1212
move onto the next module when you're ready!
13+
14+
🧝‍♀️ I'm going to help you out by removing the old hardcoded data folder!
15+
16+
<NextDiffLink> Check out the changes in the next exercise </NextDiffLink>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { type getProductById } from '#app/domain/products.server.ts'
2+
3+
export const products: NonNullable<
4+
Awaited<ReturnType<typeof getProductById>>
5+
>[] = [
6+
{
7+
id: '1',
8+
name: 'Air Max Revolution',
9+
price: 129.99,
10+
imageUrl:
11+
'https://images.pexels.com/photos/2529148/pexels-photo-2529148.jpeg?auto=compress&cs=tinysrgb&w=600',
12+
brand: {
13+
id: '1',
14+
name: 'SkyStep',
15+
},
16+
17+
category: {
18+
id: '1',
19+
name: 'Running',
20+
},
21+
variations: [],
22+
description:
23+
'Revolutionary running shoes with advanced air cushioning technology for maximum comfort and performance.',
24+
25+
reviewScore: 4.8,
26+
reviews: [],
27+
},
28+
{
29+
id: '2',
30+
name: 'Air Max Revolution',
31+
price: 129.99,
32+
imageUrl:
33+
'https://images.pexels.com/photos/2529148/pexels-photo-2529148.jpeg?auto=compress&cs=tinysrgb&w=600',
34+
brand: {
35+
id: '1',
36+
name: 'SkyStep',
37+
},
38+
39+
category: {
40+
id: '1',
41+
name: 'Running',
42+
},
43+
variations: [],
44+
description:
45+
'Revolutionary running shoes with advanced air cushioning technology for maximum comfort and performance.',
46+
47+
reviewScore: 4.8,
48+
reviews: [],
49+
},
50+
]
51+
52+
export const categories = [
53+
'All',
54+
'Running',
55+
'Casual',
56+
'Athletic',
57+
'Lifestyle',
58+
'Hiking',
59+
'Comfort',
60+
'Formal',
61+
]
62+
63+
export const brands = [
64+
'All',
65+
'SkyStep',
66+
'StreetWalk',
67+
'ProAthlete',
68+
'TimelessStep',
69+
'OutdoorPro',
70+
'VelocityRun',
71+
'SoftStep',
72+
'ExecutiveWear',
73+
]

exercises/03.data-fetching/02.problem.search-with-url/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# URL as the source of truth & Progressive enhancement
1+
# URL state management
22

33
One of the terms tied strongly with React Router is "Progressive Enhancement".
44
Progressive enhancement is the idea of building web applications that work for

exercises/03.data-fetching/02.problem.search-with-url/app/routes/_landing._index/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { getAllCategories } from '#app/domain/category.server.ts'
2-
import { getProducts } from '#app/domain/products.server.ts'
1+
import { getAllCategories } from '#app/domain/category.server.js'
2+
import { getProducts } from '#app/domain/products.server.js'
33
import { getMetaFromMatches, getMetaTitle } from '#app/utils/metadata.js'
44
import { type Route } from './+types/route'
55
import { CategoriesSection } from './categories-section'

exercises/03.data-fetching/02.problem.search-with-url/app/routes/_landing.products._index/route.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Filter, Grid, List } from 'lucide-react'
22
import { useState } from 'react'
33
import { ProductCard } from '#app/components/product-card.js'
4-
import { getAllBrands } from '#app/domain/brand.server.ts'
5-
import { getAllCategories } from '#app/domain/category.server.ts'
6-
import { getProducts } from '#app/domain/products.server.ts'
4+
import { getAllBrands } from '#app/domain/brand.server.js'
5+
import { getAllCategories } from '#app/domain/category.server.js'
6+
import { getProducts } from '#app/domain/products.server.js'
77
import {
88
getMetaFromMatches,
99
getMetaTitle,

exercises/03.data-fetching/02.solution.search-with-url/README.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# URL as the source of truth & Progressive enhancement
1+
# URL state management
22

33
Well done! You have successfully
44

0 commit comments

Comments
 (0)