upd: calender divisi
Deskripsi: - update akses user yg bukan anggota divisi pada fitur calender No Issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { TEMA } from '@/module/_global';
|
||||
import { globalRole, TEMA } from '@/module/_global';
|
||||
import { globalIsMemberDivision } from '@/module/division_new';
|
||||
import { useHookstate } from '@hookstate/core';
|
||||
import { Box, Flex, SimpleGrid, Stack, Text } from '@mantine/core';
|
||||
import { useParams } from 'next/navigation';
|
||||
@@ -7,22 +8,25 @@ import { AiOutlineFileSearch } from 'react-icons/ai';
|
||||
import { IoAddCircle } from 'react-icons/io5';
|
||||
|
||||
export default function DawerDivisionCalender() {
|
||||
const roleLogin = useHookstate(globalRole)
|
||||
const memberDivision = useHookstate(globalIsMemberDivision)
|
||||
const param = useParams<{ id: string }>()
|
||||
const tema = useHookstate(TEMA)
|
||||
return (
|
||||
<Box>
|
||||
<Stack pt={10}>
|
||||
<SimpleGrid
|
||||
cols={{ base: 2, sm: 3, lg: 3 }}
|
||||
>
|
||||
<Flex onClick={() => window.location.href = `/division/${param.id}/calender/create`} justify={'center'} align={'center'} direction={'column'} >
|
||||
<Box>
|
||||
<IoAddCircle size={30} color={tema.get().utama} />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text ta={"center"} c={tema.get().utama}>Tambah Acara</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
<SimpleGrid cols={{ base: 2, sm: 3, lg: 3 }}>
|
||||
{
|
||||
(roleLogin.get() == "user" || roleLogin.get() == "coadmin") && !memberDivision.get() ? <></> :
|
||||
<Flex onClick={() => window.location.href = `/division/${param.id}/calender/create`} justify={'center'} align={'center'} direction={'column'} >
|
||||
<Box>
|
||||
<IoAddCircle size={30} color={tema.get().utama} />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text ta={"center"} c={tema.get().utama}>Tambah Acara</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
}
|
||||
<Flex onClick={() => window.location.href = `/division/${param.id}/calender/history`} justify={'center'} align={'center'} direction={'column'} >
|
||||
<Box>
|
||||
<AiOutlineFileSearch size={30} color={tema.get().utama} />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
'use client'
|
||||
import { keyWibu, LayoutDrawer, LayoutNavbarNew, SkeletonList, TEMA } from '@/module/_global';
|
||||
import { globalRole, keyWibu, LayoutDrawer, LayoutNavbarNew, SkeletonList, TEMA } from '@/module/_global';
|
||||
import LayoutModal from '@/module/_global/layout/layout_modal';
|
||||
import { useHookstate } from '@hookstate/core';
|
||||
import { ActionIcon, Avatar, Box, Center, CopyButton, Divider, Flex, Grid, Group, SimpleGrid, Spoiler, Stack, Text, Tooltip } from '@mantine/core';
|
||||
@@ -21,6 +21,7 @@ import { funDeleteMemberCalender, funGetOneCalender } from '../lib/api_calender'
|
||||
import { IDataDetailByIdCalender, IDataDetailByIdMember } from '../lib/type_calender';
|
||||
import DrawerDetailEvent from './drawer_detail_event';
|
||||
import SkeletonDetailEvent from './skeleton_detail_event';
|
||||
import { globalIsMemberDivision } from '@/module/division_new';
|
||||
|
||||
export default function DetailEventDivision() {
|
||||
const param = useParams<{ id: string, detail: string }>()
|
||||
@@ -34,6 +35,8 @@ export default function DetailEventDivision() {
|
||||
const router = useRouter()
|
||||
const [dataChoose, setDataChoose] = useState({ id: '', name: '' })
|
||||
const tema = useHookstate(TEMA)
|
||||
const roleLogin = useHookstate(globalRole)
|
||||
const memberDivision = useHookstate(globalIsMemberDivision)
|
||||
const isMobile2 = useMediaQuery("(max-width: 460px)");
|
||||
const isMobile = useMediaQuery('(max-width: 369px)');
|
||||
const [loadingDelete, setLoadingDelete] = useState(false)
|
||||
@@ -105,9 +108,12 @@ export default function DetailEventDivision() {
|
||||
return (
|
||||
<Box>
|
||||
<LayoutNavbarNew back={`/division/${param.id}/calender/`} title="Detail Acara"
|
||||
menu={<ActionIcon variant="light" onClick={() => setOpenDrawer(true)} bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||
<HiMenu size={20} color='white' />
|
||||
</ActionIcon>} />
|
||||
menu={
|
||||
(roleLogin.get() == "user" || roleLogin.get() == "coadmin") && !memberDivision.get() ? <></>
|
||||
:
|
||||
<ActionIcon variant="light" onClick={() => setOpenDrawer(true)} bg={tema.get().bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||
<HiMenu size={20} color='white' />
|
||||
</ActionIcon>} />
|
||||
<Box p={20}>
|
||||
{loading
|
||||
?
|
||||
|
||||
Reference in New Issue
Block a user