diff options
| author | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-22 15:29:18 +0700 |
|---|---|---|
| committer | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-22 15:29:18 +0700 |
| commit | 31d6352ab8855754ef18c01763d3c1b5a68de857 (patch) | |
| tree | e9b7e67a994574b5b1ccc7c8ef805a899f561d3d /src/pages/my/menu.js | |
| parent | 7ca4c68e3c509004a84d05ebd6d66019c7e92b72 (diff) | |
Appbar component and auth hook (useAuth)
Diffstat (limited to 'src/pages/my/menu.js')
| -rw-r--r-- | src/pages/my/menu.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/pages/my/menu.js b/src/pages/my/menu.js new file mode 100644 index 00000000..7454d8d1 --- /dev/null +++ b/src/pages/my/menu.js @@ -0,0 +1,51 @@ + +import AppBar from "../../components/AppBar"; +import Layout from "../../components/Layout"; +import Link from "../../components/Link"; +import { useAuth } from "../../helpers/auth"; +import { + ChevronRightIcon, + Cog6ToothIcon, + DocumentTextIcon, + UserCircleIcon, UserIcon +} from "@heroicons/react/24/outline"; + +const menus = [ + { name: 'Riwayat Pesanan', url: '/my/profile' }, + { name: 'Faktur Penjualan', url: '/my/profile' }, + { name: 'Faktur Pajak', url: '/my/profile' }, + { name: 'Surat Jalan', url: '/my/profile' } +]; + +export default function MyMenu() { + const [auth, setAuth] = useAuth(); + + return ( + <> + <Layout> + <AppBar title="Menu Utama" /> + + <div className="p-4 flex gap-x-2 items-start bg-yellow_r-3 text-yellow_r-12"> + <div className="flex-1 flex gap-x-2 items-start"> + <UserCircleIcon className="w-6" /> + <div> + <h2>{ auth.name }</h2> + <p className="text-yellow_r-12/80">{ auth.email }</p> + </div> + </div> + <Link href="/my/profile"> + <Cog6ToothIcon className="w-6 text-yellow_r-12"/> + </Link> + </div> + + <div className="px-4 flex flex-col"> + { menus.map((menu, index) => ( + <Link href={menu.url} className="text-gray_r-12 font-normal flex gap-x-2 items-center py-4 border-b border-gray_r-6" key={index}> + { menu.name } <ChevronRightIcon className="w-5 ml-auto"/> + </Link> + )) } + </div> + </Layout> + </> + ); +}
\ No newline at end of file |
