Skip to content

Commit 53cc2ab

Browse files
committed
finish all material (still have tests to handle though)
1 parent 1c08718 commit 53cc2ab

File tree

768 files changed

+10924
-25
lines changed

Some content is hidden

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

768 files changed

+10924
-25
lines changed

exercises/04.route-paths/01.problem.dynamic-segments/src/routes/app/recipients/$id.edit.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,17 @@ export function RecipientEditRoute() {
99
const id = 'TODO'
1010
const recipient = recipients.find((r) => r.id === id)
1111

12-
if (!recipient) throw new Error(`Recipient not found with ID "${id}"`)
12+
if (!recipient) {
13+
return (
14+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
15+
<div className="bg-danger-background rounded-sm p-4">
16+
<p className="text-danger-foreground">
17+
Recipient with ID of "{id}" not found
18+
</p>
19+
</div>
20+
</div>
21+
)
22+
}
1323

1424
return (
1525
<div className="w-full overflow-y-auto p-6">

exercises/04.route-paths/01.problem.dynamic-segments/src/routes/app/recipients/$id.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ export function RecipientRoute() {
1818
const id = 'TODO'
1919
const recipient = recipients.find((r) => r.id === id)
2020

21-
if (!recipient) throw new Error(`Recipient with ID of "${id}" not found`)
21+
if (!recipient) {
22+
return (
23+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
24+
<div className="bg-danger-background rounded-sm p-4">
25+
<p className="text-danger-foreground">
26+
Recipient with ID of "{id}" not found
27+
</p>
28+
</div>
29+
</div>
30+
)
31+
}
2232

2333
return (
2434
<div className="flex min-h-0 flex-grow flex-col">

exercises/04.route-paths/01.solution.dynamic-segments/src/routes/app/recipients/$id.edit.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ export function RecipientEditRoute() {
88
const { id } = useParams()
99
const recipient = recipients.find((r) => r.id === id)
1010

11-
if (!recipient) throw new Error(`Recipient not found with ID "${id}"`)
11+
if (!recipient) {
12+
return (
13+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
14+
<div className="bg-danger-background rounded-sm p-4">
15+
<p className="text-danger-foreground">
16+
Recipient with ID of "{id}" not found
17+
</p>
18+
</div>
19+
</div>
20+
)
21+
}
1222

1323
return (
1424
<div className="w-full overflow-y-auto p-6">

exercises/04.route-paths/01.solution.dynamic-segments/src/routes/app/recipients/$id.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ export function RecipientRoute() {
1717
const { id } = useParams()
1818
const recipient = recipients.find((r) => r.id === id)
1919

20-
if (!recipient) throw new Error(`Recipient with ID of "${id}" not found`)
20+
if (!recipient) {
21+
return (
22+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
23+
<div className="bg-danger-background rounded-sm p-4">
24+
<p className="text-danger-foreground">
25+
Recipient with ID of "{id}" not found
26+
</p>
27+
</div>
28+
</div>
29+
)
30+
}
2131

2232
return (
2333
<div className="flex min-h-0 flex-grow flex-col">

exercises/05.advanced-links/01.problem.relative-links/src/routes/app/recipients/$id.edit.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ export function RecipientEditRoute() {
88
const { id } = useParams()
99
const recipient = recipients.find((r) => r.id === id)
1010

11-
if (!recipient) throw new Error(`Recipient not found with ID "${id}"`)
11+
if (!recipient) {
12+
return (
13+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
14+
<div className="bg-danger-background rounded-sm p-4">
15+
<p className="text-danger-foreground">
16+
Recipient with ID of "{id}" not found
17+
</p>
18+
</div>
19+
</div>
20+
)
21+
}
1222

1323
return (
1424
<div className="w-full overflow-y-auto p-6">

exercises/05.advanced-links/01.problem.relative-links/src/routes/app/recipients/$id.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ export function RecipientRoute() {
1717
const { id } = useParams()
1818
const recipient = recipients.find((r) => r.id === id)
1919

20-
if (!recipient) throw new Error(`Recipient with ID of "${id}" not found`)
20+
if (!recipient) {
21+
return (
22+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
23+
<div className="bg-danger-background rounded-sm p-4">
24+
<p className="text-danger-foreground">
25+
Recipient with ID of "{id}" not found
26+
</p>
27+
</div>
28+
</div>
29+
)
30+
}
2131

2232
return (
2333
<div className="flex min-h-0 flex-grow flex-col">

exercises/05.advanced-links/01.solution.relative-links/src/routes/app/recipients/$id.edit.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ export function RecipientEditRoute() {
88
const { id } = useParams()
99
const recipient = recipients.find((r) => r.id === id)
1010

11-
if (!recipient) throw new Error(`Recipient not found with ID "${id}"`)
11+
if (!recipient) {
12+
return (
13+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
14+
<div className="bg-danger-background rounded-sm p-4">
15+
<p className="text-danger-foreground">
16+
Recipient with ID of "{id}" not found
17+
</p>
18+
</div>
19+
</div>
20+
)
21+
}
1222

1323
return (
1424
<div className="w-full overflow-y-auto p-6">

exercises/05.advanced-links/01.solution.relative-links/src/routes/app/recipients/$id.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ export function RecipientRoute() {
1717
const { id } = useParams()
1818
const recipient = recipients.find((r) => r.id === id)
1919

20-
if (!recipient) throw new Error(`Recipient with ID of "${id}" not found`)
20+
if (!recipient) {
21+
return (
22+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
23+
<div className="bg-danger-background rounded-sm p-4">
24+
<p className="text-danger-foreground">
25+
Recipient with ID of "{id}" not found
26+
</p>
27+
</div>
28+
</div>
29+
)
30+
}
2131

2232
return (
2333
<div className="flex min-h-0 flex-grow flex-col">

exercises/05.advanced-links/02.problem.nav-link-class-name/src/routes/app/recipients/$id.edit.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ export function RecipientEditRoute() {
88
const { id } = useParams()
99
const recipient = recipients.find((r) => r.id === id)
1010

11-
if (!recipient) throw new Error(`Recipient not found with ID "${id}"`)
11+
if (!recipient) {
12+
return (
13+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
14+
<div className="bg-danger-background rounded-sm p-4">
15+
<p className="text-danger-foreground">
16+
Recipient with ID of "{id}" not found
17+
</p>
18+
</div>
19+
</div>
20+
)
21+
}
1222

1323
return (
1424
<div className="w-full overflow-y-auto p-6">

exercises/05.advanced-links/02.problem.nav-link-class-name/src/routes/app/recipients/$id.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ export function RecipientRoute() {
1717
const { id } = useParams()
1818
const recipient = recipients.find((r) => r.id === id)
1919

20-
if (!recipient) throw new Error(`Recipient with ID of "${id}" not found`)
20+
if (!recipient) {
21+
return (
22+
<div className="container mx-auto mt-4 flex flex-col gap-8 px-8">
23+
<div className="bg-danger-background rounded-sm p-4">
24+
<p className="text-danger-foreground">
25+
Recipient with ID of "{id}" not found
26+
</p>
27+
</div>
28+
</div>
29+
)
30+
}
2131

2232
return (
2333
<div className="flex min-h-0 flex-grow flex-col">

0 commit comments

Comments
 (0)