Skip to content

Commit

Permalink
fix header and link regressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane98c committed Dec 19, 2024
1 parent 8506dfd commit 7caf12c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 28 deletions.
50 changes: 25 additions & 25 deletions src/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ const Nav = ({ link, mode, nav, first, setExpanded }) => {

if (mode === 'homepage' || (mode === 'local' && nav === url)) {
return (
<Link
as={NextLink}
href={href}
onClick={() => {
if (nav === url) setExpanded(false)
}}
sx={sx.link(nav, url, first)}
>
<HoverArrow />
{display}
</Link>
<NextLink href={href} passHref>
<Link
onClick={() => {
if (nav === url) setExpanded(false)
}}
sx={sx.link(nav, url, first)}
>
<HoverArrow />
{display}
</Link>
</NextLink>
)
} else {
return (
Expand Down Expand Up @@ -126,22 +126,22 @@ const Header = ({ status, mode, nav, menuItems }) => {
sx={{ pointerEvents: 'all', display: 'block', width: 'fit-content' }}
>
{(mode == 'homepage' || mode == 'local') && (
<Link
as={NextLink}
href='/'
aria-label='CarbonPlan Homepage'
sx={{
display: 'block',
}}
>
<Logo
id='logo'
<NextLink href='/' passHref>
<Link
aria-label='CarbonPlan Homepage'
sx={{
cursor: 'pointer',
color: 'primary',
display: 'block',
}}
/>
</Link>
>
<Logo
id='logo'
sx={{
cursor: 'pointer',
color: 'primary',
}}
/>
</Link>
</NextLink>
)}
{(mode == null || mode == 'remote') && (
<Link
Expand Down
8 changes: 5 additions & 3 deletions src/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ const Link = (
) => {
if (internal || (href && href.startsWith('/'))) {
return (
<ThemedLink as={NextLink} href={href} ref={ref} {...props}>
{children}
</ThemedLink>
<NextLink href={href} passHref>
<ThemedLink ref={ref} {...props}>
{children}
</ThemedLink>
</NextLink>
)
} else if (tracking) {
let action
Expand Down

0 comments on commit 7caf12c

Please sign in to comment.