mirror of
https://github.com/vercel/commerce.git
synced 2025-05-28 20:26:58 +00:00
remove again
This commit is contained in:
parent
35ed989820
commit
9a8d4ab1cc
@ -1,86 +1,86 @@
|
|||||||
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 { Moon, Sun } from '@components/icons'
|
// import { Moon, Sun } 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 {
|
||||||
DropdownContent,
|
// DropdownContent,
|
||||||
DropdownMenuItem,
|
// DropdownMenuItem,
|
||||||
} from '@components/ui/Dropdown/Dropdown'
|
// } from '@components/ui/Dropdown/Dropdown'
|
||||||
|
|
||||||
const LINKS = [
|
// const LINKS = [
|
||||||
{
|
// {
|
||||||
name: 'My Orders',
|
// name: 'My Orders',
|
||||||
href: '/orders',
|
// href: '/orders',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
name: 'My Profile',
|
// name: 'My Profile',
|
||||||
href: '/profile',
|
// href: '/profile',
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
name: 'My Cart',
|
// name: 'My Cart',
|
||||||
href: '/cart',
|
// href: '/cart',
|
||||||
},
|
// },
|
||||||
]
|
// ]
|
||||||
|
|
||||||
export default function CustomerMenuContent() {
|
// export default function CustomerMenuContent() {
|
||||||
const router = useRouter()
|
// const router = useRouter()
|
||||||
const logout = useLogout()
|
// const logout = useLogout()
|
||||||
const { pathname } = useRouter()
|
// const { pathname } = useRouter()
|
||||||
const { theme, setTheme } = useTheme()
|
// const { theme, setTheme } = useTheme()
|
||||||
|
|
||||||
function handleClick(_: React.MouseEvent<HTMLAnchorElement>, href: string) {
|
// function handleClick(_: React.MouseEvent<HTMLAnchorElement>, href: string) {
|
||||||
router.push(href)
|
// router.push(href)
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<DropdownContent
|
// <DropdownContent
|
||||||
asChild
|
// asChild
|
||||||
side="bottom"
|
// side="bottom"
|
||||||
sideOffset={10}
|
// sideOffset={10}
|
||||||
className={s.root}
|
// className={s.root}
|
||||||
id="CustomerMenuContent"
|
// id="CustomerMenuContent"
|
||||||
>
|
// >
|
||||||
{LINKS.map(({ name, href }) => (
|
// {LINKS.map(({ name, href }) => (
|
||||||
<DropdownMenuItem key={href}>
|
// <DropdownMenuItem key={href}>
|
||||||
<a
|
// <a
|
||||||
className={cn(s.link, {
|
// className={cn(s.link, {
|
||||||
[s.active]: pathname === href,
|
// [s.active]: pathname === href,
|
||||||
})}
|
// })}
|
||||||
onClick={(e) => handleClick(e, href)}
|
// onClick={(e) => handleClick(e, href)}
|
||||||
>
|
// >
|
||||||
{name}
|
// {name}
|
||||||
</a>
|
// </a>
|
||||||
</DropdownMenuItem>
|
// </DropdownMenuItem>
|
||||||
))}
|
// ))}
|
||||||
<DropdownMenuItem>
|
// <DropdownMenuItem>
|
||||||
<a
|
// <a
|
||||||
className={cn(s.link, 'justify-between')}
|
// className={cn(s.link, 'justify-between')}
|
||||||
onClick={() => {
|
// onClick={() => {
|
||||||
setTheme(theme === 'dark' ? 'light' : 'dark')
|
// setTheme(theme === 'dark' ? 'light' : 'dark')
|
||||||
}}
|
// }}
|
||||||
>
|
// >
|
||||||
<div>
|
// <div>
|
||||||
Theme: <strong>{theme}</strong>{' '}
|
// Theme: <strong>{theme}</strong>{' '}
|
||||||
</div>
|
// </div>
|
||||||
<div className="ml-3">
|
// <div className="ml-3">
|
||||||
{theme == 'dark' ? (
|
// {theme == 'dark' ? (
|
||||||
<Moon width={20} height={20} />
|
// <Moon width={20} height={20} />
|
||||||
) : (
|
// ) : (
|
||||||
<Sun width={20} height={20} />
|
// <Sun width={20} height={20} />
|
||||||
)}
|
// )}
|
||||||
</div>
|
// </div>
|
||||||
</a>
|
// </a>
|
||||||
</DropdownMenuItem>
|
// </DropdownMenuItem>
|
||||||
<DropdownMenuItem>
|
// <DropdownMenuItem>
|
||||||
<a
|
// <a
|
||||||
className={cn(s.link, 'border-t border-accent-2 mt-4')}
|
// className={cn(s.link, 'border-t border-accent-2 mt-4')}
|
||||||
onClick={() => logout()}
|
// onClick={() => logout()}
|
||||||
>
|
// >
|
||||||
Logout
|
// Logout
|
||||||
</a>
|
// </a>
|
||||||
</DropdownMenuItem>
|
// </DropdownMenuItem>
|
||||||
</DropdownContent>
|
// </DropdownContent>
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
|
@ -31,6 +31,5 @@
|
|||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||||
"tailwindcss": "^4.0.14",
|
"tailwindcss": "^4.0.14",
|
||||||
"typescript": "5.8.2"
|
"typescript": "5.8.2"
|
||||||
},
|
}
|
||||||
"packageManager": "pnpm@10.6.5+sha512.cdf928fca20832cd59ec53826492b7dc25dc524d4370b6b4adbf65803d32efaa6c1c88147c0ae4e8d579a6c9eec715757b50d4fa35eea179d868eada4ed043af"
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user