summaryrefslogtreecommitdiff
path: root/src/pages/my/menu.jsx
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-02-22 11:03:34 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-02-22 11:03:34 +0700
commitf66b12fd1d0b83af0d7230d7b1565fbe00afbe3c (patch)
tree253dcf854a3c92e09ca846e86a09e5b4c5d16be1 /src/pages/my/menu.jsx
parent3c559031623649a67825ff47f34512f0eb946861 (diff)
prettier
Diffstat (limited to 'src/pages/my/menu.jsx')
-rw-r--r--src/pages/my/menu.jsx103
1 files changed, 40 insertions, 63 deletions
diff --git a/src/pages/my/menu.jsx b/src/pages/my/menu.jsx
index 3620fc36..0edc98ae 100644
--- a/src/pages/my/menu.jsx
+++ b/src/pages/my/menu.jsx
@@ -1,10 +1,10 @@
-import Divider from "@/core/components/elements/Divider/Divider"
-import Link from "@/core/components/elements/Link/Link"
-import AppLayout from "@/core/components/layouts/AppLayout"
-import useAuth from "@/core/hooks/useAuth"
-import { deleteAuth } from "@/core/utils/auth"
-import { ChevronRightIcon, UserIcon } from "@heroicons/react/24/solid"
-import { useRouter } from "next/router"
+import Divider from '@/core/components/elements/Divider/Divider'
+import Link from '@/core/components/elements/Link/Link'
+import AppLayout from '@/core/components/layouts/AppLayout'
+import useAuth from '@/core/hooks/useAuth'
+import { deleteAuth } from '@/core/utils/auth'
+import { ChevronRightIcon, UserIcon } from '@heroicons/react/24/solid'
+import { useRouter } from 'next/router'
export default function Menu() {
const auth = useAuth()
@@ -12,78 +12,56 @@ export default function Menu() {
const logout = () => {
deleteAuth()
- router.push('/login')
+ router.push('/login')
}
return (
- <AppLayout title="Menu Utama">
- <Link href="/my/profile" className="p-4 flex items-center">
- <div className="rounded-full p-3 bg-gray_r-6 text-gray_r-12/80">
- <UserIcon className="w-5" />
+ <AppLayout title='Menu Utama'>
+ <Link href='/my/profile' className='p-4 flex items-center'>
+ <div className='rounded-full p-3 bg-gray_r-6 text-gray_r-12/80'>
+ <UserIcon className='w-5' />
</div>
- <div className="ml-4">
- <div className="font-semibold text-gray_r-12">{ auth?.name }</div>
- { auth?.company && (
- <div className="badge-solid-red mt-1">Akun Bisnis</div>
- ) }
- { !auth?.company && (
- <div className="badge-gray mt-1">Akun Individu</div>
- ) }
+ <div className='ml-4'>
+ <div className='font-semibold text-gray_r-12'>{auth?.name}</div>
+ {auth?.company && <div className='badge-solid-red mt-1'>Akun Bisnis</div>}
+ {!auth?.company && <div className='badge-gray mt-1'>Akun Individu</div>}
</div>
- <div className="ml-auto !text-gray_r-12">
- <ChevronRightIcon className="w-6" />
+ <div className='ml-auto !text-gray_r-12'>
+ <ChevronRightIcon className='w-6' />
</div>
</Link>
<Divider />
- <div className="flex flex-col gap-y-6 py-6">
+ <div className='flex flex-col gap-y-6 py-6'>
<div>
- <MenuHeader>
- Aktivitas Pembelian
- </MenuHeader>
+ <MenuHeader>Aktivitas Pembelian</MenuHeader>
- <div className="divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4">
- <LinkItem href="/my/transactions">
- Daftar Transaksi
- </LinkItem>
- <LinkItem href="/my/invoices">
- Invoice & Faktur Pajak
- </LinkItem>
- <LinkItem href="/my/wishlist">
- Wishlist
- </LinkItem>
+ <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
+ <LinkItem href='/my/transactions'>Daftar Transaksi</LinkItem>
+ <LinkItem href='/my/invoices'>Invoice & Faktur Pajak</LinkItem>
+ <LinkItem href='/my/wishlist'>Wishlist</LinkItem>
</div>
</div>
<div>
- <MenuHeader>
- Pusat Bantuan
- </MenuHeader>
+ <MenuHeader>Pusat Bantuan</MenuHeader>
- <div className="divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4">
- <LinkItem href="/">
- Customer Support
- </LinkItem>
- <LinkItem href="/">
- F.A.Q
- </LinkItem>
+ <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
+ <LinkItem href='/'>Customer Support</LinkItem>
+ <LinkItem href='/'>F.A.Q</LinkItem>
</div>
</div>
<div>
- <MenuHeader>
- Pengaturan Akun
- </MenuHeader>
+ <MenuHeader>Pengaturan Akun</MenuHeader>
- <div className="divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4">
- <LinkItem href="/my/address">
- Daftar Alamat
- </LinkItem>
+ <div className='divide-y divide-gray_r-6 border-y border-gray_r-6 mt-4'>
+ <LinkItem href='/my/address'>Daftar Alamat</LinkItem>
</div>
- <div onClick={logout} className="p-4 mt-2">
- <button className="w-full btn-red">Keluar Akun</button>
+ <div onClick={logout} className='p-4 mt-2'>
+ <button className='w-full btn-red'>Keluar Akun</button>
</div>
</div>
</div>
@@ -92,17 +70,16 @@ export default function Menu() {
}
const MenuHeader = ({ children, ...props }) => (
- <div {...props} className="font-medium px-4 flex">
- { children }
-
+ <div {...props} className='font-medium px-4 flex'>
+ {children}
</div>
)
const LinkItem = ({ children, ...props }) => (
- <Link {...props} className="!text-gray_r-11 !font-normal p-4 flex items-center">
- { children }
- <div className="ml-auto !text-gray_r-11">
- <ChevronRightIcon className="w-5" />
+ <Link {...props} className='!text-gray_r-11 !font-normal p-4 flex items-center'>
+ {children}
+ <div className='ml-auto !text-gray_r-11'>
+ <ChevronRightIcon className='w-5' />
</div>
</Link>
-) \ No newline at end of file
+)