-
Notifications
You must be signed in to change notification settings - Fork 1
/
header.tsx
46 lines (40 loc) · 1.5 KB
/
header.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { NavLink } from '@remix-run/react';
import classNames from 'classnames';
import { useCartOpen } from '~/lib/cart-open-context';
import styles from './header.module.scss';
export interface HeaderProps {
className?: string;
}
export const Header = ({ className }: HeaderProps) => {
const { setIsOpen: setCartOpen } = useCartOpen();
return (
<div className={classNames(styles.root, className)}>
<NavLink to="/" className={styles.logo}>
LOGO
</NavLink>
<div className={styles.menu}>
<NavLink
to="/"
className={({ isActive }) => classNames(styles.menuButton, { [styles.activeMenuItem]: isActive })}
>
Home
</NavLink>
<NavLink
to="/category/all-products"
className={({ isActive }) => classNames(styles.menuButton, { [styles.activeMenuItem]: isActive })}
>
Products
</NavLink>
<NavLink
to="/about"
className={({ isActive }) => classNames(styles.menuButton, { [styles.activeMenuItem]: isActive })}
>
About
</NavLink>
<button onClick={() => setCartOpen(true)} className={classNames(styles.menuButton, styles.cartButton)}>
Cart
</button>
</div>
</div>
);
};