mirror of
https://github.com/vercel/commerce.git
synced 2025-06-20 06:01:21 +00:00
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import { FC } from 'react'
|
|
import Link from 'next/link'
|
|
import { Logo, Container } from '@components/ui'
|
|
import { Searchbar, UserNav } from '@components/common'
|
|
import NavbarRoot from './NavbarRoot'
|
|
import s from './Navbar.module.css'
|
|
|
|
const searchPath = [
|
|
{ link: '/search?q=clothes', name: 'Clothes' },
|
|
{ link: '/search?q=accessories', name: 'Accessories' },
|
|
{ link: '/search?q=shoes', name: 'Shoes' },
|
|
]
|
|
|
|
const Navbar: FC = () => (
|
|
<NavbarRoot>
|
|
<Container>
|
|
<div className="relative flex flex-row justify-between py-4 align-center md:py-6">
|
|
<div className="flex items-center flex-1">
|
|
<Link href="/">
|
|
<a className={s.logo} aria-label="Logo">
|
|
<Logo />
|
|
</a>
|
|
</Link>
|
|
<nav className="hidden ml-6 space-x-4 lg:block">
|
|
<Link href="/search">
|
|
<a className={s.link}>All</a>
|
|
</Link>
|
|
{searchPath.map((e) => (
|
|
<Link href={e.link}>
|
|
<a className={s.link}>{e.name}</a>
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
</div>
|
|
|
|
<div className="justify-center flex-1 hidden lg:flex">
|
|
<Searchbar />
|
|
</div>
|
|
|
|
<div className="flex justify-end flex-1 space-x-8">
|
|
<UserNav />
|
|
</div>
|
|
</div>
|
|
|
|
<div className="flex pb-4 lg:px-6 lg:hidden">
|
|
<Searchbar id="mobile-search" />
|
|
</div>
|
|
</Container>
|
|
</NavbarRoot>
|
|
)
|
|
|
|
export default Navbar
|