4
0
forked from crowetic/commerce

Adding partial night mode

This commit is contained in:
Belen Curcio
2020-10-12 21:40:39 -03:00
parent 1629f718b0
commit 6bf209eccd
18 changed files with 135 additions and 191 deletions

View File

@@ -1,16 +1,16 @@
import cn from 'classnames'
import { FC } from 'react'
import s from './Navbar.module.css'
import { Logo, Container } from '@components/ui'
import { Searchbar } from '@components/core'
import { UserNav } from '@components/core'
import { FC } from 'react'
import Link from 'next/link'
import { useTheme } from 'next-themes'
import { Logo, Container } from '@components/ui'
import { Searchbar, Toggle, UserNav } from '@components/core'
interface Props {
className?: string
}
const Navbar: FC<Props> = ({ className }) => {
const rootClassName = className
const { theme, setTheme } = useTheme()
return (
<div className={rootClassName}>
<Container>
@@ -38,7 +38,13 @@ const Navbar: FC<Props> = ({ className }) => {
<Searchbar />
</div>
<div className="flex flex-initial md:flex-1 justify-end">
<div className="flex flex-initial md:flex-1 justify-end space-x-8">
<Toggle
checked={theme === 'dark'}
onChange={() =>
theme === 'dark' ? setTheme('light') : setTheme('dark')
}
/>
<UserNav />
</div>
</div>