mirror of
https://github.com/vercel/commerce.git
synced 2025-08-09 18:31:23 +00:00
.github
.vscode
packages
site
assets
components
auth
cart
checkout
common
Avatar
FeatureBar
Footer
Head
HomeAllProductsGrid
I18nWidget
Layout
Navbar
Navbar.module.css
Navbar.tsx
NavbarRoot.tsx
index.ts
SEO
Searchbar
SidebarLayout
UserNav
index.ts
icons
product
ui
wishlist
search.tsx
config
lib
pages
public
.env.template
.eslintrc
.gitignore
.npmrc
.prettierignore
.prettierrc
commerce-config.js
commerce.config.json
global.d.ts
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
.editorconfig
.gitignore
.prettierignore
.prettierrc
README.md
license.md
package.json
pnpm-lock.yaml
pnpm-workspace.yaml
turbo.json
* Adding Dropdown Component * Styling Issues * Wishlist Fix * Fixes for Wishlist View * Hearts now work again * Rollback ts * Removing extra config to disable BigCommerce * Fixes for Wishlist View * Remove transition/animation for mobile * New Updates. * New Updates. * Dropdown fix * Polish * export * export * revert tsconfig Co-authored-by: Luis Alvarez D. <luis@vercel.com> Co-authored-by: Dom Sip <dom@vercel.com> Co-authored-by: Luis Alvarez D. <luis@vercel.com>
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import { FC } from 'react'
|
|
import Link from 'next/link'
|
|
import s from './Navbar.module.css'
|
|
import NavbarRoot from './NavbarRoot'
|
|
import { Logo, Container } from '@components/ui'
|
|
import { Searchbar, UserNav } from '@components/common'
|
|
|
|
interface Link {
|
|
href: string
|
|
label: string
|
|
}
|
|
|
|
interface NavbarProps {
|
|
links?: Link[]
|
|
}
|
|
|
|
const Navbar: FC<NavbarProps> = ({ links }) => (
|
|
<NavbarRoot>
|
|
<Container clean className="mx-auto max-w-8xl px-6">
|
|
<div className={s.nav}>
|
|
<div className="flex items-center flex-1">
|
|
<Link href="/">
|
|
<a className={s.logo} aria-label="Logo">
|
|
<Logo />
|
|
</a>
|
|
</Link>
|
|
<nav className={s.navMenu}>
|
|
<Link href="/search">
|
|
<a className={s.link}>All</a>
|
|
</Link>
|
|
{links?.map((l) => (
|
|
<Link href={l.href} key={l.href}>
|
|
<a className={s.link}>{l.label}</a>
|
|
</Link>
|
|
))}
|
|
</nav>
|
|
</div>
|
|
{process.env.COMMERCE_SEARCH_ENABLED && (
|
|
<div className="justify-center flex-1 hidden lg:flex">
|
|
<Searchbar />
|
|
</div>
|
|
)}
|
|
<div className="flex items-center justify-end flex-1 space-x-8">
|
|
<UserNav />
|
|
</div>
|
|
</div>
|
|
{process.env.COMMERCE_SEARCH_ENABLED && (
|
|
<div className="flex pb-4 lg:px-6 lg:hidden">
|
|
<Searchbar id="mobile-search" />
|
|
</div>
|
|
)}
|
|
</Container>
|
|
</NavbarRoot>
|
|
)
|
|
|
|
export default Navbar
|