main
This commit is contained in:
@@ -35,7 +35,7 @@ export function AppHeader() {
|
||||
}, [pathname]);
|
||||
const activeCategorySlug = React.useMemo(() => {
|
||||
if (activeBoardId) {
|
||||
const found = categories.find((c) => c.boards.some((b) => b.id === activeBoardId));
|
||||
const found = categories.find((c) => c.boards.some((b) => b.slug === activeBoardId));
|
||||
return found?.slug ?? null;
|
||||
}
|
||||
if (pathname === "/boards") {
|
||||
@@ -337,7 +337,7 @@ export function AppHeader() {
|
||||
style={idx === categories.length - 1 ? { minWidth: 120 } : undefined}
|
||||
>
|
||||
<Link
|
||||
href={cat.boards?.[0]?.id ? `/boards/${cat.boards[0].id}` : `/boards?category=${cat.slug}`}
|
||||
href={cat.boards?.[0]?.slug ? `/boards/${cat.boards[0].slug}` : `/boards?category=${cat.slug}`}
|
||||
className={`block w-full px-2 py-2 text-sm font-medium transition-colors duration-200 hover:text-neutral-900 whitespace-nowrap ${
|
||||
activeCategorySlug === cat.slug ? "text-neutral-900" : "text-neutral-700"
|
||||
}`}
|
||||
@@ -381,11 +381,11 @@ export function AppHeader() {
|
||||
{cat.boards.map((b) => (
|
||||
<Link
|
||||
key={b.id}
|
||||
href={`/boards/${b.id}`}
|
||||
href={`/boards/${b.slug}`}
|
||||
className={`rounded px-2 py-1 text-sm transition-colors duration-150 hover:bg-neutral-100 hover:text-neutral-900 text-center whitespace-nowrap ${
|
||||
activeBoardId === b.id ? "bg-neutral-100 text-neutral-900 font-medium" : "text-neutral-700"
|
||||
activeBoardId === b.slug ? "bg-neutral-100 text-neutral-900 font-medium" : "text-neutral-700"
|
||||
}`}
|
||||
aria-current={activeBoardId === b.id ? "page" : undefined}
|
||||
aria-current={activeBoardId === b.slug ? "page" : undefined}
|
||||
>
|
||||
{b.name}
|
||||
</Link>
|
||||
@@ -416,7 +416,7 @@ export function AppHeader() {
|
||||
<div className="mb-2 font-semibold text-neutral-800">{cat.name}</div>
|
||||
<div className="flex flex-col gap-1">
|
||||
{cat.boards.map((b) => (
|
||||
<Link key={b.id} href={`/boards/${b.id}`} onClick={() => setMobileOpen(false)} className="rounded px-2 py-1 text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900">
|
||||
<Link key={b.id} href={`/boards/${b.slug}`} onClick={() => setMobileOpen(false)} className="rounded px-2 py-1 text-neutral-700 hover:bg-neutral-100 hover:text-neutral-900">
|
||||
{b.name}
|
||||
</Link>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user