From 82cb719ad61292a60c4885b945995faaf6dbc960 Mon Sep 17 00:00:00 2001 From: Nine <31674307+ninecodes@users.noreply.github.com> Date: Thu, 25 Nov 2021 19:09:21 +0100 Subject: [PATCH] Feature/hamburger menu (#540) * Setup Mobile Menu Sidebar * Setup Basic Mobile Menu Items Styling * Implement full width styling for mobile devices * Cleanup Co-authored-by: Nine --- components/common/Layout/Layout.tsx | 21 ++++++---- components/common/Navbar/Navbar.tsx | 1 + .../common/SidebarLayout/SidebarLayout.tsx | 2 +- .../MenuSidebarView.module.css | 7 ++++ .../MenuSidebarView/MenuSidebarView.tsx | 41 +++++++++++++++++++ .../common/UserNav/MenuSidebarView/index.ts | 6 +++ components/common/UserNav/UserNav.module.css | 17 +++++--- components/common/UserNav/UserNav.tsx | 22 +++++++++- components/icons/Menu.tsx | 21 ++++++++++ components/ui/Sidebar/Sidebar.tsx | 2 +- 10 files changed, 123 insertions(+), 17 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 44c4e54e1..5ee6ea530 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, LoadingDots } from '@components/ui' import PaymentMethodView from '@components/checkout/PaymentMethodView' import CheckoutSidebarView from '@components/checkout/CheckoutSidebarView' +import MenuSidebarView, { Link } from '../UserNav/MenuSidebarView' import LoginView from '@components/auth/LoginView' import s from './Layout.module.css' @@ -74,12 +75,14 @@ const ModalUI: FC = () => { ) : null } -const SidebarView: FC<{ sidebarView: string; closeSidebar(): any }> = ({ - sidebarView, - closeSidebar, -}) => { +const SidebarView: FC<{ + sidebarView: string + closeSidebar(): any + links: Link[] +}> = ({ sidebarView, closeSidebar, links }) => { return ( + {sidebarView === 'MOBILEMENU_VIEW' && } {sidebarView === 'CART_VIEW' && } {sidebarView === 'CHECKOUT_VIEW' && } {sidebarView === 'PAYMENT_VIEW' && } @@ -88,10 +91,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 } @@ -113,7 +120,7 @@ const Layout: FC = ({
{children}