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:
17
src/module/_global/components/wrap_layout.tsx
Normal file
17
src/module/_global/components/wrap_layout.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client'
|
||||
import { useHookstate } from "@hookstate/core";
|
||||
import { globalRole } from "../bin/val_global";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
|
||||
export default function WrapLayout({ children, role }: { children: React.ReactNode, role: any }) {
|
||||
const roleLogin = useHookstate(globalRole)
|
||||
|
||||
useShallowEffect(() => {
|
||||
roleLogin.set(role)
|
||||
}, [])
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user