mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 23:16:59 +00:00
Polish
This commit is contained in:
parent
17e8d4c4da
commit
3fb8fffa7b
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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)}>
|
||||||
|
@ -1,18 +1,3 @@
|
|||||||
.link {
|
|
||||||
@apply text-primary flex cursor-pointer px-6 py-3
|
|
||||||
transition ease-in-out duration-150 leading-6
|
|
||||||
font-medium items-center capitalize w-full box-border
|
|
||||||
outline-0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link:hover {
|
|
||||||
@apply bg-accent-1 outline-none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.link.active {
|
|
||||||
@apply font-bold bg-accent-2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.root {
|
.root {
|
||||||
@apply inset-0 fixed;
|
@apply inset-0 fixed;
|
||||||
left: 72px;
|
left: 72px;
|
||||||
@ -22,10 +7,6 @@
|
|||||||
transition: none;
|
transition: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeholder {
|
|
||||||
height: 68px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen(lg) {
|
@media screen(lg) {
|
||||||
.root {
|
.root {
|
||||||
@apply static;
|
@apply static;
|
||||||
@ -33,3 +14,18 @@
|
|||||||
height: inherit;
|
height: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
@apply text-primary flex cursor-pointer px-6 py-3
|
||||||
|
transition ease-in-out duration-150 leading-6
|
||||||
|
font-medium items-center capitalize w-full box-border
|
||||||
|
outline-0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link:hover {
|
||||||
|
@apply bg-accent-1 outline-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link.active {
|
||||||
|
@apply font-bold bg-accent-2;
|
||||||
|
}
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user