upd: projects
Deskripsi: - membatasi akses user yang bukan anggota project No Issues
This commit is contained in:
@@ -12,6 +12,7 @@ import { IoAddCircle } from 'react-icons/io5';
|
||||
import { MdCancel } from 'react-icons/md';
|
||||
import { useWibuRealtime } from 'wibu-realtime';
|
||||
import { funGetOneProjectById } from '../lib/api_project';
|
||||
import { globalIsMemberProject } from '../lib/val_project';
|
||||
|
||||
export default function NavbarDetailProject() {
|
||||
const router = useRouter()
|
||||
@@ -20,6 +21,7 @@ export default function NavbarDetailProject() {
|
||||
const [grup, setGrup] = useState("")
|
||||
const [isOpen, setOpen] = useState(false)
|
||||
const roleLogin = useHookstate(globalRole)
|
||||
const memberProject = useHookstate(globalIsMemberProject)
|
||||
const tema = useHookstate(TEMA)
|
||||
const [reason, setReason] = useState("")
|
||||
const [dataRealTime, setDataRealtime] = useWibuRealtime({
|
||||
@@ -57,16 +59,18 @@ export default function NavbarDetailProject() {
|
||||
return (
|
||||
<>
|
||||
<LayoutNavbarNew back={`/project?group=${grup}`} title={name} menu={
|
||||
<ActionIcon
|
||||
variant="light"
|
||||
bg={tema.get().bgIcon}
|
||||
size="lg"
|
||||
radius="lg"
|
||||
aria-label="Settings"
|
||||
onClick={() => { setOpen(true) }}
|
||||
>
|
||||
<HiMenu size={20} color="white" />
|
||||
</ActionIcon>
|
||||
(roleLogin.get() == "user" || roleLogin.get() == "coadmin") && !memberProject.get() ? <></>
|
||||
:
|
||||
<ActionIcon
|
||||
variant="light"
|
||||
bg={tema.get().bgIcon}
|
||||
size="lg"
|
||||
radius="lg"
|
||||
aria-label="Settings"
|
||||
onClick={() => { setOpen(true) }}
|
||||
>
|
||||
<HiMenu size={20} color="white" />
|
||||
</ActionIcon>
|
||||
} />
|
||||
|
||||
<LayoutDrawer opened={isOpen} title={'Menu'} onClose={() => setOpen(false)}>
|
||||
|
||||
Reference in New Issue
Block a user