Skip to content

Commit

Permalink
feat(ui): active page indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Oct 4, 2024
1 parent ae42d45 commit 28d3510
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/~/app/layout/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ function Tools({ username }: { username?: string | undefined }) {
}

function Nav() {
const { req } = useRequestContext();

return (
<nav
class="fr-nav"
Expand All @@ -93,6 +95,7 @@ function Nav() {
<ul class="fr-nav__list">
<li class="fr-nav__item">
<a
aria-current={req.routePath.startsWith("/moderations")}
class="fr-nav__link"
href={urls.moderations.$url().pathname}
target="_self"
Expand All @@ -102,6 +105,7 @@ function Nav() {
</li>
<li class="fr-nav__item">
<a
aria-current={req.routePath.startsWith("/users")}
class="fr-nav__link"
href={urls.users.$url().pathname}
target="_self"
Expand All @@ -111,6 +115,10 @@ function Nav() {
</li>
<li class="fr-nav__item">
<a
aria-current={
req.routePath.startsWith("/organizations") &&
!req.routePath.startsWith("/organizations/domains")
}
class="fr-nav__link"
href={urls.organizations.$url().pathname}
target="_self"
Expand All @@ -120,6 +128,7 @@ function Nav() {
</li>
<li class="fr-nav__item">
<a
aria-current={req.routePath.startsWith("/organizations/domains")}
class="fr-nav__link"
href={urls.organizations.domains.$url().pathname}
target="_self"
Expand Down

0 comments on commit 28d3510

Please sign in to comment.