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