4
0
forked from crowetic/commerce

UI State added

This commit is contained in:
Belen Curcio
2020-10-01 09:39:31 -03:00
parent 7cf79cea91
commit 0e48451767
4 changed files with 16 additions and 15 deletions

View File

@@ -12,9 +12,7 @@ interface Props {
const Navbar: FunctionComponent<Props> = ({ className }) => {
const rootClassName = cn(s.root, className);
const { dispatch } = useUI();
const handleCartClick = () => dispatch("OPEN_SIDEBAR");
const { openSidebar } = useUI();
return (
<Container className={rootClassName}>
@@ -28,7 +26,7 @@ const Navbar: FunctionComponent<Props> = ({ className }) => {
</nav>
</div>
<nav className="flex flex-row items-center">
<Bag className="mr-6" onClick={handleCartClick} />
<Bag className="mr-6" onClick={openSidebar} />
<Heart className="mr-6" />
<Avatar />
</nav>