Merge pull request #62 from bipproduction/amalia/18-jul-24
Amalia/18 jul 24
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { WARNA } from '@/module/_global';
|
import { WARNA } from '@/module/_global';
|
||||||
import { ActionIcon, Box, Group, Text, TextInput } from '@mantine/core';
|
import { ActionIcon, Box, Center, Divider, Grid, Group, Text, TextInput } from '@mantine/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TfiAnnouncement } from "react-icons/tfi";
|
import { TfiAnnouncement } from "react-icons/tfi";
|
||||||
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
import { HiMagnifyingGlass } from 'react-icons/hi2';
|
||||||
@@ -10,42 +10,58 @@ const dataPengumuman = [
|
|||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Dinas',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Dinas',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Adat',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Dinas',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'PKK',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Karang Taruna',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 7,
|
id: 7,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara terima kasih yang sangat banyak',
|
||||||
|
grup: 'Dinas',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 8,
|
id: 8,
|
||||||
name: 'Lembaga Pengkreditan Desa',
|
name: 'Lembaga Pengkreditan Desa',
|
||||||
desc: 'Diharapkan semua untuk melakukan upacara ben...'
|
desc: 'Diharapkan semua untuk melakukan upacara ben...',
|
||||||
|
grup: 'Dinas',
|
||||||
|
tgl: '7 Juli 2024'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -68,22 +84,29 @@ export default function ListAnnouncement() {
|
|||||||
/>
|
/>
|
||||||
{dataPengumuman.map((v, i) => {
|
{dataPengumuman.map((v, i) => {
|
||||||
return (
|
return (
|
||||||
<Box pt={20} key={i} onClick={() => {
|
<Box key={i} mt={15}>
|
||||||
router.push(`/announcement/${v.id}`)
|
<Box onClick={() => {
|
||||||
}}>
|
router.push(`/announcement/${v.id}`)
|
||||||
<Group align='center' style={{
|
}}>
|
||||||
borderBottom: `1px solid #D9D9D9`,
|
<Grid>
|
||||||
padding: 10,
|
<Grid.Col span={2}>
|
||||||
}} >
|
<Center>
|
||||||
<Box>
|
<ActionIcon variant="light" bg={'#FCAA4B'} size={50} radius={100} aria-label="icon">
|
||||||
<ActionIcon variant="light" bg={'#FCAA4B'} size={50} radius={100} aria-label="icon">
|
<TfiAnnouncement color={WARNA.biruTua} size={25} />
|
||||||
<TfiAnnouncement color={WARNA.biruTua} size={25} />
|
</ActionIcon>
|
||||||
</ActionIcon>
|
</Center>
|
||||||
</Box>
|
</Grid.Col>
|
||||||
<Box>
|
<Grid.Col span={10}>
|
||||||
<Text fw={'bold'} c={WARNA.biruTua}>{v.name}</Text>
|
<Text fw={'bold'} c={WARNA.biruTua}>{v.name}</Text>
|
||||||
</Box>
|
<Text c={WARNA.biruTua} truncate={'end'}>{v.desc}</Text>
|
||||||
</Group>
|
<Group justify='space-between' mt={5}>
|
||||||
|
<Text fw={'lighter'} c={WARNA.biruTua} fz={13}>{v.grup}</Text>
|
||||||
|
<Text fw={'lighter'} c={WARNA.biruTua} fz={13}>{v.tgl}</Text>
|
||||||
|
</Group>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Box>
|
||||||
|
<Divider my={15}/>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -1,28 +1,52 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { LayoutDrawer, LayoutNavbarNew, WARNA } from "@/module/_global";
|
import { LayoutDrawer, LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||||
import { Box, Button, Center, Flex, Group, Input, Stack, Text } from "@mantine/core";
|
import { Box, Button, Center, Flex, Group, Select, Stack, Text, TextInput } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { IoIosArrowDropright } from "react-icons/io";
|
import { IoIosArrowDropright } from "react-icons/io";
|
||||||
import { BsFiletypeCsv } from "react-icons/bs";
|
import { BsFiletypeCsv } from "react-icons/bs";
|
||||||
import ResultsDateAndTask from "./results_date-and_task";
|
import ResultsDateAndTask from "./results_date-and_task";
|
||||||
import ResultsFile from "./results_file";
|
import ResultsFile from "./results_file";
|
||||||
|
import LayoutModal from "@/module/_global/layout/layout_modal";
|
||||||
|
import toast from "react-hot-toast";
|
||||||
|
|
||||||
export default function CreateProject({ searchParams }: { searchParams: any }) {
|
export default function CreateProject({ searchParams }: { searchParams: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
const [isModal, setModal] = useState(false)
|
||||||
|
|
||||||
|
function onTrue(val: boolean) {
|
||||||
|
if (val) {
|
||||||
|
toast.success("Sukses! Data tersimpan");
|
||||||
|
router.push('/project')
|
||||||
|
}
|
||||||
|
setModal(false)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew back="/project" title="tambah proyek" menu />
|
<LayoutNavbarNew back="/project" title="tambah proyek" menu />
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Input
|
<Select
|
||||||
|
placeholder="Pilih Grup" label="Grup" w={"100%"} size="md" required withAsterisk radius={30}
|
||||||
styles={{
|
styles={{
|
||||||
input: {
|
input: {
|
||||||
border: `1px solid ${"#D6D8F6"}`,
|
border: `1px solid ${"#D6D8F6"}`,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
data={['Dinas', 'Adat', 'LPD', 'PKK']}
|
||||||
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Proyek"
|
||||||
|
styles={{
|
||||||
|
input: {
|
||||||
|
border: `1px solid ${"#D6D8F6"}`,
|
||||||
|
borderRadius: 10,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
required withAsterisk
|
||||||
placeholder="Nama Proyek"
|
placeholder="Nama Proyek"
|
||||||
size="md"
|
size="md"
|
||||||
/>
|
/>
|
||||||
@@ -69,14 +93,12 @@ export default function CreateProject({ searchParams }: { searchParams: any }) {
|
|||||||
(searchParams.button == 'yes') &&
|
(searchParams.button == 'yes') &&
|
||||||
<>
|
<>
|
||||||
<Box mt="xl">
|
<Box mt="xl">
|
||||||
<Button color="white" bg={WARNA.biruTua} size="lg" radius={30} fullWidth onClick={() => router.push('/project')}>
|
<Button color="white" bg={WARNA.biruTua} size="lg" radius={30} fullWidth onClick={() => setModal(true)}>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
|
|
||||||
@@ -125,6 +147,10 @@ export default function CreateProject({ searchParams }: { searchParams: any }) {
|
|||||||
</Box>
|
</Box>
|
||||||
</Flex>
|
</Flex>
|
||||||
</LayoutDrawer>
|
</LayoutDrawer>
|
||||||
|
|
||||||
|
<LayoutModal opened={isModal} onClose={() => setModal(false)}
|
||||||
|
description="Apakah Anda yakin ingin mengubah data?"
|
||||||
|
onYes={(val) => { onTrue(val) }} />
|
||||||
</Box >
|
</Box >
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user