diff options
Diffstat (limited to 'src/lib/auth')
| -rw-r--r-- | src/lib/auth/components/Menu.jsx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/lib/auth/components/Menu.jsx b/src/lib/auth/components/Menu.jsx new file mode 100644 index 00000000..9a73609d --- /dev/null +++ b/src/lib/auth/components/Menu.jsx @@ -0,0 +1,47 @@ +import Link from '@/core/components/elements/Link/Link' +import { useRouter } from 'next/router' + +const Menu = () => { + const router = useRouter() + + const routeStartWith = (route) => router.pathname.startsWith(route) + + return ( + <div className='grid grid-cols-1 bg-white border border-gray_r-6 rounded py-2 px-4'> + <div className='mt-4 mb-1 font-medium'>Menu</div> + <LinkItem href='/my/transactions' active={routeStartWith('/my/transaction')}> + Daftar Transaksi + </LinkItem> + <LinkItem href='/my/invoices' active={routeStartWith('/my/invoice')}> + Invoice & Faktur Pajak + </LinkItem> + <LinkItem href='/my/wishlist' active={routeStartWith('/my/wishlist')}> + Wishlist + </LinkItem> + + <div className='mt-4 mb-1 font-medium'>Pusat Bantuan</div> + <LinkItem href='/'>Layanan Pelanggan</LinkItem> + + <div className='mt-4 mb-1 font-medium'>Pengaturan Akun</div> + <LinkItem href='/my/address' active={routeStartWith('/my/address')}> + Daftar Alamat + </LinkItem> + <button type='button' className='text-gray_r-12/80 p-2 text-left'> + Keluar Akun + </button> + </div> + ) +} + +const LinkItem = ({ children, ...props }) => ( + <Link + {...props} + className={`!text-gray_r-12/80 !font-normal p-2 rounded ${ + props.active == true ? 'bg-gray_r-3' : '' + }`} + > + {children} + </Link> +) + +export default Menu |
