upd: pembatasan user
Deskripsi: - menyimpan role pada variable global - pembatasan pada position - pembatasan pada fitur home - memasang log user pada position No Issues
This commit is contained in:
@@ -1,20 +1,22 @@
|
||||
'use client'
|
||||
import { WARNA, LayoutDrawer, LayoutNavbarNew } from "@/module/_global";
|
||||
import { WARNA, LayoutDrawer, LayoutNavbarNew, globalRole } from "@/module/_global";
|
||||
import { ActionIcon, Box } from "@mantine/core";
|
||||
import { HiMenu } from "react-icons/hi";
|
||||
import DrawerListPosition from "./drawer_list_position";
|
||||
import { useState } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
|
||||
export default function NavbarListPosition() {
|
||||
const [isOpen, setOpen] = useState(false)
|
||||
const roleLogin = useHookstate(globalRole)
|
||||
return (
|
||||
<>
|
||||
<LayoutNavbarNew back="/home" title="Jabatan"
|
||||
menu={
|
||||
menu={(roleLogin.get() != "user") ?
|
||||
<ActionIcon onClick={() => setOpen(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||
<HiMenu size={20} color='white' />
|
||||
</ActionIcon>
|
||||
: <></>
|
||||
}
|
||||
/>
|
||||
<LayoutDrawer opened={isOpen} title={'Menu'} onClose={() => setOpen(false)}>
|
||||
|
||||
Reference in New Issue
Block a user