Skip to content

Commit 0bf1c7f

Browse files
fix: center weekly update row item text (#4841)
Center the week and year labels in the updates detail selector by rendering them as a stacked, centered item.
1 parent f9ef119 commit 0bf1c7f

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

apps/web/src/routes/_view/updates/$slug.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,24 @@ function Component() {
109109
</Link>
110110
)}
111111
{sorted.map((u) => {
112-
const label = getWeekLabel(u.date).replace("Week ", "W");
112+
const [weekLabel, yearLabel] = getWeekLabel(u.date)
113+
.replace("Week ", "W")
114+
.split(" ");
113115
const isCurrent = u.slug === update.slug;
114116
return (
115117
<Link
116118
key={u.slug}
117119
to="/updates/$slug/"
118120
params={{ slug: u.slug }}
119121
className={cn([
120-
"rounded px-2 py-1 text-sm transition-colors",
122+
"flex flex-col items-center justify-center rounded px-2 py-1 text-center text-sm leading-tight transition-colors",
121123
isCurrent
122124
? "bg-stone-100 font-medium text-stone-900"
123125
: "text-stone-500 hover:text-stone-800",
124126
])}
125127
>
126-
{label}
128+
<span>{weekLabel}</span>
129+
<span>{yearLabel}</span>
127130
</Link>
128131
);
129132
})}

0 commit comments

Comments
 (0)