upd: pengumuman
Deskripsi : - list pengumuman - tambah pengumuman - routing list dan tambah pengumuman - drawer list pengumuman No Issues
This commit is contained in:
9
src/app/(application)/announcement/create/page.tsx
Normal file
9
src/app/(application)/announcement/create/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { ViewCreateAnnouncement } from "@/module/announcement";
|
||||||
|
|
||||||
|
function Page() {
|
||||||
|
return (
|
||||||
|
<ViewCreateAnnouncement />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Page;
|
||||||
9
src/app/(application)/announcement/page.tsx
Normal file
9
src/app/(application)/announcement/page.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { ViewListAnnouncement } from "@/module/announcement";
|
||||||
|
|
||||||
|
function Page() {
|
||||||
|
return (
|
||||||
|
<ViewListAnnouncement/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Page;
|
||||||
87
src/module/announcement/component/list_announcement.tsx
Normal file
87
src/module/announcement/component/list_announcement.tsx
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
import { isDrawer, LayoutDrawer, WARNA } from '@/module/_global';
|
||||||
|
import { ActionIcon, Box, Group, Text, TextInput } from '@mantine/core';
|
||||||
|
import React from 'react';
|
||||||
|
import { TfiAnnouncement } from "react-icons/tfi";
|
||||||
|
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
||||||
|
|
||||||
|
const dataPengumuman = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 7,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 8,
|
||||||
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
|
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
export default function ListAnnouncement() {
|
||||||
|
return (
|
||||||
|
<Box p={20}>
|
||||||
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: WARNA.biruTua,
|
||||||
|
borderColor: WARNA.biruTua,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
leftSection={<HiMagnifyingGlass size={20} />}
|
||||||
|
placeholder="Pencarian"
|
||||||
|
/>
|
||||||
|
{dataPengumuman.map((v, i) => {
|
||||||
|
return (
|
||||||
|
<Box pt={20} key={i}>
|
||||||
|
<Group align='center' style={{
|
||||||
|
borderBottom: `1px solid #D9D9D9`,
|
||||||
|
padding: 10,
|
||||||
|
}} >
|
||||||
|
<Box>
|
||||||
|
<ActionIcon variant="light" bg={'#FCAA4B'} size={50} radius={100} aria-label="icon">
|
||||||
|
<TfiAnnouncement color={WARNA.biruTua} size={25} />
|
||||||
|
</ActionIcon>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text fw={'bold'} c={WARNA.biruTua}>{v.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Group>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
48
src/module/announcement/component/ui/drawer_announcement.tsx
Normal file
48
src/module/announcement/component/ui/drawer_announcement.tsx
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import { isDrawer, LayoutDrawer, WARNA } from '@/module/_global';
|
||||||
|
import { useHookstate } from '@hookstate/core';
|
||||||
|
import { Box, Button, Center, Flex, Group, SimpleGrid, Stack, Text, TextInput } from '@mantine/core';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { IoAddCircle } from "react-icons/io5";
|
||||||
|
import { RiFilter2Line } from "react-icons/ri";
|
||||||
|
|
||||||
|
export default function DrawerAnnouncement() {
|
||||||
|
const openDrawer = useHookstate(isDrawer)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
|
function onCLose() {
|
||||||
|
openDrawer.set(false)
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<Stack pt={10}>
|
||||||
|
<SimpleGrid
|
||||||
|
cols={{ base: 3, sm: 3, lg: 3 }}
|
||||||
|
>
|
||||||
|
<Flex justify={'center'} align={'center'} direction={'column'}
|
||||||
|
onClick={() => {
|
||||||
|
router.push('/announcement/create')
|
||||||
|
onCLose()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Box>
|
||||||
|
<IoAddCircle size={30} color={WARNA.biruTua} />
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text c={WARNA.biruTua} ta='center'>Tambah Pengumuman</Text>
|
||||||
|
</Box>
|
||||||
|
</Flex>
|
||||||
|
|
||||||
|
<Flex justify={'center'} align={'center'} direction={'column'} >
|
||||||
|
<Box>
|
||||||
|
<RiFilter2Line size={30} color={WARNA.biruTua} />
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text c={WARNA.biruTua} ta='center'>Filter</Text>
|
||||||
|
</Box>
|
||||||
|
</Flex>
|
||||||
|
</SimpleGrid>
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
37
src/module/announcement/component/ui/navbar_announcement.tsx
Normal file
37
src/module/announcement/component/ui/navbar_announcement.tsx
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
"use client"
|
||||||
|
import { isDrawer, LayoutDrawer, LayoutIconBack, LayoutNavbarHome, WARNA } from '@/module/_global';
|
||||||
|
import { ActionIcon, Box, Drawer, Grid, Group, Text } from '@mantine/core';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import React from 'react';
|
||||||
|
import { HiMenu } from "react-icons/hi";
|
||||||
|
import { useHookstate } from '@hookstate/core';
|
||||||
|
import DrawerAnnouncement from './drawer_announcement';
|
||||||
|
|
||||||
|
export default function NavbarAnnouncement() {
|
||||||
|
const openDrawer = useHookstate(isDrawer)
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<LayoutNavbarHome>
|
||||||
|
<Grid justify='center' align='center'>
|
||||||
|
<Grid.Col span="auto">
|
||||||
|
<LayoutIconBack back='/home' />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text ta={'center'} fw={'bold'} c={'white'}>PENGUMUMAN</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span="auto">
|
||||||
|
<Group justify='flex-end'>
|
||||||
|
<ActionIcon onClick={() => openDrawer.set(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||||
|
<HiMenu size={20} color='white' />
|
||||||
|
</ActionIcon>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</LayoutNavbarHome>
|
||||||
|
<LayoutDrawer opened={openDrawer.get()} title={'MENU'} onClose={() => openDrawer.set(false)}>
|
||||||
|
<DrawerAnnouncement />
|
||||||
|
</LayoutDrawer>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
'use client'
|
||||||
|
import { LayoutIconBack, LayoutNavbarHome } from "@/module/_global";
|
||||||
|
import { Box, Grid, Text } from "@mantine/core";
|
||||||
|
|
||||||
|
export default function NavbarCreateAnnouncement() {
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<LayoutNavbarHome>
|
||||||
|
<Grid justify='center' align='center'>
|
||||||
|
<Grid.Col span="auto">
|
||||||
|
<LayoutIconBack />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Text ta={'center'} fw={'bold'} c={'white'}>Tambah Pengumuman</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span="auto"></Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</LayoutNavbarHome>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import ViewCreateAnnouncement from "./view/view_create_announcement";
|
||||||
|
import ViewListAnnouncement from "./view/view_list_announcement";
|
||||||
|
|
||||||
|
export { ViewListAnnouncement }
|
||||||
|
export { ViewCreateAnnouncement }
|
||||||
60
src/module/announcement/view/view_create_announcement.tsx
Normal file
60
src/module/announcement/view/view_create_announcement.tsx
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import { WARNA } from "@/module/_global";
|
||||||
|
import { Box, Stack, TextInput, Button, Textarea } from "@mantine/core";
|
||||||
|
import { HiOutlineChevronRight, HiUser } from "react-icons/hi2";
|
||||||
|
import NavbarCreateAnnouncement from "../component/ui/navbar_create_announcement";
|
||||||
|
|
||||||
|
export default function ViewCreateAnnouncement() {
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<NavbarCreateAnnouncement />
|
||||||
|
<Stack
|
||||||
|
align="center"
|
||||||
|
justify="center"
|
||||||
|
gap="xs"
|
||||||
|
pt={30}
|
||||||
|
px={20}
|
||||||
|
>
|
||||||
|
<TextInput
|
||||||
|
size="md" type="text" radius={30} placeholder="Judul Pengumuman" withAsterisk label="Judul" w={"100%"}
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: WARNA.biruTua,
|
||||||
|
borderColor: WARNA.biruTua,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Textarea
|
||||||
|
size="md"
|
||||||
|
radius={20}
|
||||||
|
w={"100%"}
|
||||||
|
label="Pengumuman"
|
||||||
|
withAsterisk
|
||||||
|
placeholder="Deskripsi Pengumuman"
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
color: WARNA.biruTua,
|
||||||
|
borderRadius: WARNA.biruTua,
|
||||||
|
borderColor: WARNA.biruTua,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button rightSection={<HiOutlineChevronRight size={14} />} variant="default" fullWidth radius={30} size="md" mt={10}>
|
||||||
|
Pilih Anggota
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
<Box mt={30} mx={20}>
|
||||||
|
<Button
|
||||||
|
c={"white"}
|
||||||
|
bg={WARNA.biruTua}
|
||||||
|
size="md"
|
||||||
|
radius={30}
|
||||||
|
fullWidth
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</Button>
|
||||||
|
</Box>
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
12
src/module/announcement/view/view_list_announcement.tsx
Normal file
12
src/module/announcement/view/view_list_announcement.tsx
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Box } from "@mantine/core";
|
||||||
|
import NavbarAnnouncement from "../component/ui/navbar_announcement";
|
||||||
|
import ListAnnouncement from "../component/list_announcement";
|
||||||
|
|
||||||
|
export default function ViewListAnnouncement() {
|
||||||
|
return (
|
||||||
|
<Box>
|
||||||
|
<NavbarAnnouncement />
|
||||||
|
<ListAnnouncement />
|
||||||
|
</Box>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -42,7 +42,7 @@ export default function Features() {
|
|||||||
<Text fz={15} c={WARNA.biruTua}>Proyek</Text>
|
<Text fz={15} c={WARNA.biruTua}>Proyek</Text>
|
||||||
</Center>
|
</Center>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box onClick={() => router.push('/announcement')}>
|
||||||
<Center>
|
<Center>
|
||||||
<ActionIcon variant="gradient"
|
<ActionIcon variant="gradient"
|
||||||
size={68}
|
size={68}
|
||||||
|
|||||||
Reference in New Issue
Block a user