Skip to content

Commit 8d943bd

Browse files
committed
more cleanup
1 parent a8e8ec6 commit 8d943bd

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

exercises/99.final/01.solution.final/src/data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"messages": [
1010
{
1111
"id": "1",
12-
"text": "Thank you for being my partner in every adventure and my comfort in every storm. I love you more than you know.",
12+
"text": "Thank you for being my partner in every adventure and my comfort in every storm.\n\nI love you more than you know.",
1313
"sentAt": "2044-06-06T10:00:00Z",
1414
"status": "sent"
1515
},

exercises/99.final/01.solution.final/src/routes/app/recipients/$id.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function RecipientRoute() {
104104
</Button>
105105
</div>
106106
{/* break-words does not work for long strings of unbroken text */}
107-
<p className="text-sm [word-break:break-word] md:text-base">
107+
<p className="text-sm [word-break:break-word] whitespace-pre-line md:text-base">
108108
{message.text}
109109
</p>
110110
</div>

exercises/99.final/01.solution.final/src/routes/app/recipients/layout.tsx

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
import clsx from 'clsx'
12
import { NavLink, Outlet } from 'react-router'
23
import { ButtonLink } from '#src/components/button.tsx'
34
import { Icon } from '#src/components/icon.tsx'
45
import { recipients } from '#src/data.json'
56

67
export function RecipientsLayout() {
78
return (
8-
<div className="container mx-auto flex min-h-0 flex-grow flex-col p-4 md:p-8">
9+
<div className="container mx-auto flex min-h-0 flex-grow flex-col px-4 pt-4 md:px-8 md:pt-8">
910
<div className="mb-8 flex items-center justify-between">
1011
<h1 className="text-4xl font-bold">Recipients</h1>
1112
<ButtonLink
@@ -20,23 +21,24 @@ export function RecipientsLayout() {
2021
</div>
2122

2223
<div className="bg-background-alt flex min-h-0 flex-1 flex-col md:flex-row">
23-
<div className="flex max-h-32 min-h-32 flex-col gap-4 overflow-auto border-b-2 px-8 py-4 md:max-h-none md:min-w-32 md:border-r md:border-b-0">
24+
<div className="flex max-h-32 min-h-32 flex-col gap-4 overflow-auto border-b-2 py-4 pr-4 pl-1 md:max-h-none md:min-w-32 md:border-r md:border-b-0">
2425
{recipients.map((recipient) => (
2526
<NavLink
2627
key={recipient.id}
2728
to={`/recipients/${recipient.id}`}
2829
className={({ isActive }) =>
29-
isActive
30-
? 'flex items-center gap-2 text-xl underline'
31-
: 'text-xl'
30+
clsx('text-xl', isActive ? 'underline' : '')
3231
}
3332
>
3433
{({ isActive }) => (
35-
<div className="flex items-center gap-2">
34+
<div className="flex items-center gap-1">
3635
<Icon
3736
name="ArrowRight"
3837
size="sm"
39-
className={isActive ? 'opacity-100' : 'opacity-0'}
38+
className={clsx(
39+
isActive ? 'opacity-100' : 'opacity-0',
40+
'transition-opacity',
41+
)}
4042
/>
4143
{recipient.name}
4244
</div>

0 commit comments

Comments
 (0)