Adding UI Context

This commit is contained in:
Belen Curcio
2020-09-30 15:56:32 -03:00
parent 3dc2c16cea
commit 1af9a980df
6 changed files with 40 additions and 28 deletions

View File

@@ -1,11 +1,11 @@
import React, { FunctionComponent } from "react";
// import s from "./CartSidebarView.module.css";
import { Button } from "@components/ui";
import { Trash } from "@components/icon";
import { Trash, Cross } from "@components/icon";
import { useUI } from "@components/ui/context";
interface Props {}
const CartSidebarView: FunctionComponent<Props> = () => {
const CartSidebarView: FunctionComponent = () => {
const { dispatch } = useUI();
return (
<>
<header className="px-4 py-6 sm:px-6 border-b border-gray-200">
@@ -17,22 +17,11 @@ const CartSidebarView: FunctionComponent<Props> = () => {
</div>
<div className="h-7 flex items-center">
<button
onClick={() => dispatch("CLOSE_SIDEBAR")}
aria-label="Close panel"
className="text-gray-400 hover:text-gray-500 transition ease-in-out duration-150"
>
<svg
className="h-6 w-6"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
<Cross className="h-6 w-6" />
</button>
</div>
</div>