Skip to content

Commit 49eb981

Browse files
committed
fix(web): navbar-highlighting
1 parent 60d395e commit 49eb981

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

web/src/layout/Header/navbar/Explore.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ const Explore: React.FC = () => {
5858

5959
const links = useMemo(
6060
() => [
61-
{ to: "/", text: "Home" },
61+
{ identifier: "/", to: "/", text: "Home" },
6262
{
63+
identifier: "/attachment/",
6364
to: isUndefined(mainCurate) ? "/" : `/attachment/?url=${getIpfsUrl(mainCurate.registry.policyURI ?? "")}`,
6465
text: "Curation Policy",
6566
},
@@ -70,9 +71,13 @@ const Explore: React.FC = () => {
7071
return (
7172
<Container>
7273
<Title>Explore</Title>
73-
{links.map(({ to, text }) => (
74+
{links.map(({ to, text, identifier }) => (
7475
<LinkContainer key={text}>
75-
<StyledLink to={to} onClick={toggleIsOpen} isActive={location.pathname.startsWith(to)}>
76+
<StyledLink
77+
to={to}
78+
onClick={toggleIsOpen}
79+
isActive={identifier === "/" ? location.pathname === "/" : location.pathname.startsWith(identifier)}
80+
>
7681
{text}
7782
</StyledLink>
7883
</LinkContainer>

0 commit comments

Comments
 (0)