diff options
| author | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-03-27 11:28:58 +0700 |
|---|---|---|
| committer | HATEC\SPVDEV001 <tri.susilo@altama.co.id> | 2023-03-27 11:28:58 +0700 |
| commit | e77ab00b04426f85d04d211f5ab4a511e754ed4f (patch) | |
| tree | 191721d87e780df07dabf06fb0136fa9d6de0b68 /src/lib/auth/components | |
| parent | 8876e48c35f41b77e61ba90bd95ab4c993d67e9e (diff) | |
| parent | bc04e721d51e149709ab3cfaf5e77ef034511860 (diff) | |
Merge branch 'master' of https://bitbucket.org/altafixco/next-indoteknik
Diffstat (limited to 'src/lib/auth/components')
| -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 |
