From b34fdc362c7868125970470866ba2c4052da9ebf Mon Sep 17 00:00:00 2001 From: Nine Date: Wed, 20 Oct 2021 18:08:48 +0200 Subject: [PATCH] Setup Mobile Menu Sidebar --- components/common/Layout/Layout.tsx | 21 ++++++---- components/common/Navbar/Navbar.tsx | 1 + .../MenuSidebarView.module.css | 0 .../MenuSidebarView/MenuSidebarView.tsx | 38 +++++++++++++++++++ .../common/UserNav/MenuSidebarView/index.ts | 1 + components/common/UserNav/UserNav.tsx | 28 ++++++++++++-- components/icons/Menu.tsx | 21 ++++++++++ 7 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 components/common/UserNav/MenuSidebarView/MenuSidebarView.module.css create mode 100644 components/common/UserNav/MenuSidebarView/MenuSidebarView.tsx create mode 100644 components/common/UserNav/MenuSidebarView/index.ts create mode 100644 components/icons/Menu.tsx diff --git a/components/common/Layout/Layout.tsx b/components/common/Layout/Layout.tsx index 2e53bed62..0ee613cc3 100644 --- a/components/common/Layout/Layout.tsx +++ b/components/common/Layout/Layout.tsx @@ -13,6 +13,7 @@ import { useAcceptCookies } from '@lib/hooks/useAcceptCookies' import { Sidebar, Button, Modal, LoadingDots } from '@components/ui' import PaymentMethodView from '@components/checkout/PaymentMethodView' import CheckoutSidebarView from '@components/checkout/CheckoutSidebarView' +import MenuSidebarView from '../UserNav/MenuSidebarView' import LoginView from '@components/auth/LoginView' import s from './Layout.module.css' @@ -69,12 +70,14 @@ const ModalUI: FC = () => { ) : null } -const SidebarView: FC<{ sidebarView: string; closeSidebar(): any }> = ({ - sidebarView, - closeSidebar, -}) => { +const SidebarView: FC<{ + sidebarView: string + closeSidebar(): any + links: any +}> = ({ sidebarView, closeSidebar, links }) => { return ( + {sidebarView === 'MOBILEMENU_VIEW' && } {sidebarView === 'CART_VIEW' && } {sidebarView === 'CHECKOUT_VIEW' && } {sidebarView === 'PAYMENT_VIEW' && } @@ -83,10 +86,14 @@ const SidebarView: FC<{ sidebarView: string; closeSidebar(): any }> = ({ ) } -const SidebarUI: FC = () => { +const SidebarUI: FC<{ links: any }> = ({ links }) => { const { displaySidebar, closeSidebar, sidebarView } = useUI() return displaySidebar ? ( - + ) : null } @@ -108,7 +115,7 @@ const Layout: FC = ({
{children}