fix collection nav link to point to user's collection
The Collection nav link now points to /{username}/collection/characters
instead of /collection. Also updates isNavSelected to properly detect
when on any collection page.
This commit is contained in:
parent
2aa961b5e6
commit
d107d56f82
1 changed files with 8 additions and 1 deletions
|
|
@ -41,7 +41,9 @@
|
||||||
// Localized links
|
// Localized links
|
||||||
const galleryHref = $derived(localizeHref('/teams/explore'))
|
const galleryHref = $derived(localizeHref('/teams/explore'))
|
||||||
const guidesHref = $derived(localizeHref('/guides'))
|
const guidesHref = $derived(localizeHref('/guides'))
|
||||||
const collectionHref = $derived(localizeHref('/collection'))
|
const collectionHref = $derived(
|
||||||
|
username ? localizeHref(`/${username}/collection/characters`) : localizeHref('/collection')
|
||||||
|
)
|
||||||
const meHref = $derived(localizeHref('/me'))
|
const meHref = $derived(localizeHref('/me'))
|
||||||
const loginHref = $derived(localizeHref('/auth/login'))
|
const loginHref = $derived(localizeHref('/auth/login'))
|
||||||
const registerHref = $derived(localizeHref('/auth/register'))
|
const registerHref = $derived(localizeHref('/auth/register'))
|
||||||
|
|
@ -101,6 +103,11 @@
|
||||||
return path === href
|
return path === href
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For collection, check if we're on any collection page
|
||||||
|
if (href === collectionHref) {
|
||||||
|
return path.includes('/collection')
|
||||||
|
}
|
||||||
|
|
||||||
// Exact match or starts with href + /
|
// Exact match or starts with href + /
|
||||||
return path === href || path.startsWith(href + '/')
|
return path === href || path.startsWith(href + '/')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue