This commit is contained in:
Bel Curcio 2022-03-15 19:36:35 +01:00
parent 17e8d4c4da
commit 3fb8fffa7b
4 changed files with 21 additions and 42 deletions

View File

@ -83,9 +83,9 @@ const SidebarView: React.FC<{
return ( return (
<Sidebar onClose={closeSidebar}> <Sidebar onClose={closeSidebar}>
{sidebarView === 'CART_VIEW' && <CartSidebarView />} {sidebarView === 'CART_VIEW' && <CartSidebarView />}
{sidebarView === 'CHECKOUT_VIEW' && <CheckoutSidebarView />}
{sidebarView === 'PAYMENT_VIEW' && <PaymentMethodView />}
{sidebarView === 'SHIPPING_VIEW' && <ShippingView />} {sidebarView === 'SHIPPING_VIEW' && <ShippingView />}
{sidebarView === 'PAYMENT_VIEW' && <PaymentMethodView />}
{sidebarView === 'CHECKOUT_VIEW' && <CheckoutSidebarView />}
{sidebarView === 'MOBILE_MENU_VIEW' && <MenuSidebarView links={links} />} {sidebarView === 'MOBILE_MENU_VIEW' && <MenuSidebarView links={links} />}
</Sidebar> </Sidebar>
) )
@ -95,9 +95,9 @@ const SidebarUI: React.FC<{ links: LinkProps[] }> = ({ links }) => {
const { displaySidebar, closeSidebar, sidebarView } = useUI() const { displaySidebar, closeSidebar, sidebarView } = useUI()
return displaySidebar ? ( return displaySidebar ? (
<SidebarView <SidebarView
links={links}
sidebarView={sidebarView} sidebarView={sidebarView}
closeSidebar={closeSidebar} closeSidebar={closeSidebar}
links={links}
/> />
) : null ) : null
} }

View File

@ -12,8 +12,8 @@ type ComponentProps = { className?: string } & (
const SidebarLayout: FC<ComponentProps> = ({ const SidebarLayout: FC<ComponentProps> = ({
children, children,
className, className,
handleClose,
handleBack, handleBack,
handleClose,
}) => { }) => {
return ( return (
<div className={cn(s.root, className)}> <div className={cn(s.root, className)}>

View File

@ -1,3 +1,20 @@
.root {
@apply inset-0 fixed;
left: 72px;
z-index: 10;
height: 100vh;
min-width: 100vw;
transition: none;
}
@media screen(lg) {
.root {
@apply static;
min-width: inherit;
height: inherit;
}
}
.link { .link {
@apply text-primary flex cursor-pointer px-6 py-3 @apply text-primary flex cursor-pointer px-6 py-3
transition ease-in-out duration-150 leading-6 transition ease-in-out duration-150 leading-6
@ -12,24 +29,3 @@
.link.active { .link.active {
@apply font-bold bg-accent-2; @apply font-bold bg-accent-2;
} }
.root {
@apply inset-0 fixed;
left: 72px;
z-index: 10;
height: 100vh;
min-width: 100vw;
transition: none;
}
.placeholder {
height: 68px;
}
@media screen(lg) {
.root {
@apply static;
min-width: inherit;
height: inherit;
}
}

View File

@ -1,15 +1,12 @@
import cn from 'clsx' import cn from 'clsx'
import { useTheme } from 'next-themes' import { useTheme } from 'next-themes'
import { useRouter } from 'next/router' import { useRouter } from 'next/router'
import { UserNav } from '@components/common' import { Moon, Sun } from '@components/icons'
import { Moon, Sun, Cross } from '@components/icons'
import s from './CustomerMenuContent.module.css' import s from './CustomerMenuContent.module.css'
import useLogout from '@framework/auth/use-logout' import useLogout from '@framework/auth/use-logout'
import { import {
Dropdown as DropdownRoot,
DropdownMenuItem,
DropdownContent, DropdownContent,
DropdownTrigger, DropdownMenuItem,
} from '@components/ui/Dropdown/Dropdown' } from '@components/ui/Dropdown/Dropdown'
const LINKS = [ const LINKS = [
@ -27,8 +24,6 @@ const LINKS = [
}, },
] ]
export const Dropdown = <DropdownRoot />
export default function CustomerMenuContent() { export default function CustomerMenuContent() {
const router = useRouter() const router = useRouter()
const logout = useLogout() const logout = useLogout()
@ -47,18 +42,6 @@ export default function CustomerMenuContent() {
className={s.root} className={s.root}
id="CustomerMenuContent" id="CustomerMenuContent"
> >
{/* <div className={s.placeholder}>
<button
aria-label="Close"
className="hover:text-accent-5 transition ease-in-out duration-150 flex items-center focus:outline-none mr-6"
>
<Cross className="h-6 w-6 hover:text-accent-3" />
<span className="ml-2 text-accent-7 text-sm ">Close</span>
</button>
<div className={s.nav}>
<UserNav />
</div>
</div> */}
{LINKS.map(({ name, href }) => ( {LINKS.map(({ name, href }) => (
<DropdownMenuItem key={href}> <DropdownMenuItem key={href}>
<a <a