Disable prefetching in main nav

This commit is contained in:
Sam Becker 2024-03-02 18:06:22 -06:00
parent d334b11cba
commit b85872b98e

View File

@ -8,6 +8,7 @@ export default function SwitcherItem({
onClick, onClick,
active, active,
noPadding, noPadding,
prefetch = false,
}: { }: {
icon: JSX.Element icon: JSX.Element
href?: string href?: string
@ -15,6 +16,7 @@ export default function SwitcherItem({
onClick?: () => void onClick?: () => void
active?: boolean active?: boolean
noPadding?: boolean noPadding?: boolean
prefetch?: boolean
}) { }) {
const className = clsx( const className = clsx(
classNameProp, classNameProp,
@ -38,7 +40,9 @@ export default function SwitcherItem({
return ( return (
href href
? <Link {...{ href, className }}>{renderIcon()}</Link> ? <Link {...{ href, className, prefetch }}>
{renderIcon()}
</Link>
: <div {...{ onClick, className }}>{renderIcon()}</div> : <div {...{ onClick, className }}>{renderIcon()}</div>
); );
}; };