make sticky header optional via prop

This commit is contained in:
2022-02-16 10:30:18 -05:00
parent b6c018875f
commit 17104d765b
14 changed files with 116 additions and 120 deletions
+2 -3
View File
@@ -1,8 +1,7 @@
import Link from "next/link";
import classNames from "classnames/bind";
import classNames from "classnames";
import styles from "./MenuLink.module.css";
const cx = classNames.bind(styles);
export type MenuLinkProps = {
href?: string;
@@ -20,7 +19,7 @@ const MenuLink = ({ icon: Icon, href, text, current, className }: MenuLinkProps)
if (href) {
return (
<Link href={href} prefetch={false}>
<a className={cx(styles.link, { current: !!current }, className)}>
<a className={classNames(styles.link, current && styles.current, className)}>
<Icon className={styles.icon} /> <span className={styles.label}>{text}</span>
</a>
</Link>