Skip to content

Commit

Permalink
Merge pull request #121 from sbv-world-health-org-metrics/ajhenry/nav
Browse files Browse the repository at this point in the history
Fix navigation for tabs
  • Loading branch information
ipc103 authored Mar 26, 2024
2 parents 052ef50 + 3e92aae commit 9f6c016
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 28 deletions.
15 changes: 13 additions & 2 deletions app/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ export const Layout: FC<PropsWithChildren> = ({ children }) => {
</Box>
)}
<TabNav aria-label="Main" className="mt-8">
<TabNav.Link href="/" selected={router.pathname === '/'}>
<TabNav.Link
href="/"
selected={!router.pathname.includes('documentation')}
onClick={(e) => {
e.preventDefault();
router.push('/');
}}
>
Repositories
</TabNav.Link>
<TabNav.Link
href="/documentation"
selected={router.pathname === '/documentation'}
selected={router.pathname.includes('documentation')}
onClick={(e) => {
e.preventDefault();
router.push('/documentation');
}}
>
Documentation
</TabNav.Link>
Expand Down
26 changes: 0 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f6c016

Please sign in to comment.