Perbaikan Banner
This commit is contained in:
@@ -7,7 +7,7 @@ import { useParams, useRouter } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { FaFile, FaPencil, FaTrash } from 'react-icons/fa6';
|
||||
|
||||
function ListBanner() {
|
||||
function ListBanner() {
|
||||
const tema = useHookstate(TEMA)
|
||||
const [searchQuery, setSearchQuery] = useState('')
|
||||
const [loading, setLoading] = useState(true);
|
||||
@@ -16,29 +16,12 @@ function ListBanner() {
|
||||
const router = useRouter();
|
||||
const param = useParams<{ id: string }>()
|
||||
const [isOpenModalView, setOpenModalView] = useState(false)
|
||||
const [isOpen, setOpen] = useState(false)
|
||||
const [isOpenModal, setOpenModal] = useState(false)
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [idDataStorage, setIdDataStorage] = useState('')
|
||||
const [isExtension, setExtension] = useState('')
|
||||
|
||||
|
||||
|
||||
// async function onTrue(val: boolean) {
|
||||
// if (val) {
|
||||
// const response = await funDeleteBanner(param.id)
|
||||
// if (response.success) {
|
||||
// toast.success(response.message)
|
||||
// onDeleted(true)
|
||||
// } else {
|
||||
// toast.error(response.message)
|
||||
// onDeleted(false)
|
||||
// }
|
||||
// } else {
|
||||
// onDeleted(false)
|
||||
// }
|
||||
|
||||
// setOpen(false)
|
||||
// }
|
||||
|
||||
return (
|
||||
<Box pt={2}>
|
||||
<Box p={20}>
|
||||
@@ -53,15 +36,15 @@ function ListBanner() {
|
||||
height: 85,
|
||||
backgroundColor: 'transparent',
|
||||
border: `1px solid ${tema.get().bgTotalKegiatan}`
|
||||
|
||||
|
||||
}}>
|
||||
<Group mt={"15"}>
|
||||
<ActionIcon variant='transparent' w={"100"}>
|
||||
<Image radius={"xs"} src={"/assets/img/banner/Banner-1.png"} alt='' w={76} h={38.9} />
|
||||
<ActionIcon variant='transparent' w={"100"}>
|
||||
<Image radius={"xs"} src={"/assets/img/banner/Banner-1.png"} alt='' w={76} h={38.9} />
|
||||
</ActionIcon>
|
||||
<Flex direction={"column"}>
|
||||
<Text c={"dark"} >Banner {index + 1}</Text>
|
||||
<Text fz={"h6"} fw={"inherit"} c={"dark"}>Banner</Text>
|
||||
<Text c={"dark"} >Banner {index + 1}</Text>
|
||||
<Text fz={"h6"} fw={"inherit"} c={"dark"}>Banner</Text>
|
||||
</Flex>
|
||||
</Group>
|
||||
</Paper>
|
||||
@@ -71,49 +54,53 @@ function ListBanner() {
|
||||
</Anchor>
|
||||
</Box>
|
||||
|
||||
<LayoutDrawer
|
||||
opened={openDrawer}
|
||||
onClose={() => setOpenDrawer(false)}
|
||||
title={<Text lineClamp={1}>{"Menu"}</Text>}
|
||||
>
|
||||
<SimpleGrid
|
||||
m={20}
|
||||
cols={{ base: 3, sm: 3, lg: 3 }}
|
||||
>
|
||||
<Box>
|
||||
<Anchor underline='never' onClick={() => router.push("/banner/edit/[id]")}>
|
||||
<Flex direction="column" align="center" justify="center">
|
||||
<FaPencil size={30} color={WARNA.biruTua} />
|
||||
<Text c={"dark"} mt={10} ta="center">Edit</Text>
|
||||
<LayoutDrawer opened={openDrawer} title={'Menu'} onClose={() => setOpenDrawer(false)}>
|
||||
<Box>
|
||||
<Stack pt={10}>
|
||||
<SimpleGrid
|
||||
cols={{ base: 2, sm: 3, lg: 3 }}
|
||||
style={{
|
||||
alignContent: "flex-start",
|
||||
alignItems: "flex-start"
|
||||
}}
|
||||
>
|
||||
<Flex onClick={() => router.push("/banner/edit/[id]")} direction="column" align="center" justify="center" pb={20}>
|
||||
<Box>
|
||||
<FaPencil size={30} color={WARNA.biruTua} />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text c={tema.get().utama} fz={{ base: 'sm', md: 'md'}}>Edit</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
</Anchor>
|
||||
</Box>
|
||||
<Box>
|
||||
<Anchor underline='never' onClick={() => {setOpenModalView(true)}}>
|
||||
<Flex direction="column" align="center" justify="center">
|
||||
<FaFile size={30} color={WARNA.biruTua} />
|
||||
<Text c={"dark"} mt={10} ta="center">Lihat File</Text>
|
||||
</Flex>
|
||||
</Anchor>
|
||||
</Box>
|
||||
<Box>
|
||||
<Anchor underline='never' onClick={() => {setOpen(true)}}>
|
||||
<Flex direction="column" align="center" justify="center">
|
||||
<FaTrash size={30} color={WARNA.biruTua} />
|
||||
<Text c={"dark"} mt={10} ta="center">Hapus</Text>
|
||||
</Flex>
|
||||
</Anchor>
|
||||
</Box>
|
||||
</SimpleGrid>
|
||||
</LayoutDrawer>
|
||||
|
||||
<LayoutModal opened={isOpen} onClose={() => setOpen(false)}
|
||||
<Flex onClick={() => { setOpenModalView(true) }} direction={"column"} align={"center"} justify={"center"}>
|
||||
<Box>
|
||||
<FaFile size={30} color={tema.get().utama} />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text c={tema.get().utama} fz={{ base: 'sm', md: 'md'}}>Lihat File</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
|
||||
<Flex onClick={() => { setOpenModal(true) }} direction={"column"} align={"center"} justify={"center"}>
|
||||
<Box>
|
||||
<FaTrash size={30} color={tema.get().utama} />
|
||||
</Box>
|
||||
<Box>
|
||||
<Text c={tema.get().utama} fz={{ base: 'sm', md: 'md'}}>Hapus</Text>
|
||||
</Box>
|
||||
</Flex>
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</Box>
|
||||
</LayoutDrawer>
|
||||
<LayoutModal opened={isOpenModal} onClose={() => setOpenModal(false)}
|
||||
description='Apakah Anda yakin ingin menghapus banner?'
|
||||
onYes={(val) => { setOpen(false) }} />
|
||||
|
||||
onYes={(val) => { setOpenModal(false) }} />
|
||||
|
||||
<LayoutModalViewFile opened={isOpenModalView} onClose={() => setOpenModalView(false)} file={idDataStorage} extension={isExtension} fitur='task' />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
export default ListBanner;
|
||||
|
||||
export default ListBanner;
|
||||
|
||||
Reference in New Issue
Block a user