diff --git a/.gitignore b/.gitignore index fd3dbb5..f3e886e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,9 @@ yarn-error.log* # local env files .env*.local +# env +.env + # vercel .vercel diff --git a/package.json b/package.json index 2f92bd9..e30e597 100644 --- a/package.json +++ b/package.json @@ -38,11 +38,14 @@ "embla-carousel-react": "^7.1.0", "lodash": "^4.17.21", "next": "14.2.4", + "prettier": "^3.3.2", "react": "^18", "react-dom": "^18", "react-icons": "^5.2.1", "react-simple-toasts": "^5.10.0", - "recharts": "2" + "readdirp": "^3.6.0", + "recharts": "2", + "yargs": "^17.7.2" }, "devDependencies": { "@types/node": "^20.14.9", diff --git a/src/app/(application)/announcement/[id]/page.tsx b/src/app/(application)/announcement/[id]/page.tsx new file mode 100644 index 0000000..872826e --- /dev/null +++ b/src/app/(application)/announcement/[id]/page.tsx @@ -0,0 +1,9 @@ +import { ViewDetailAnnouncement } from "@/module/announcement"; + +function Page({ params }: { params: { id: string } }) { + return ( + + ) +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/announcement/create/page.tsx b/src/app/(application)/announcement/create/page.tsx new file mode 100644 index 0000000..c4f77f1 --- /dev/null +++ b/src/app/(application)/announcement/create/page.tsx @@ -0,0 +1,9 @@ +import { ViewCreateAnnouncement } from "@/module/announcement"; + +function Page() { + return ( + + ) +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/announcement/edit/[id]/page.tsx b/src/app/(application)/announcement/edit/[id]/page.tsx new file mode 100644 index 0000000..b9f348b --- /dev/null +++ b/src/app/(application)/announcement/edit/[id]/page.tsx @@ -0,0 +1,9 @@ +import { ViewEditAnnouncement } from "@/module/announcement"; + +function Page({ params }: { params: { id: any } }) { + return ( + + ) +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/announcement/page.tsx b/src/app/(application)/announcement/page.tsx new file mode 100644 index 0000000..4551abb --- /dev/null +++ b/src/app/(application)/announcement/page.tsx @@ -0,0 +1,9 @@ +import { ViewListAnnouncement } from "@/module/announcement"; + +function Page() { + return ( + + ) +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/group/page.tsx b/src/app/(application)/group/page.tsx new file mode 100644 index 0000000..ec46c75 --- /dev/null +++ b/src/app/(application)/group/page.tsx @@ -0,0 +1,10 @@ +import { ViewGroup } from '@/module/group'; +import React from 'react'; + +function Page() { + return ( + + ); +} + +export default Page; diff --git a/src/app/(application)/member/[id]/page.tsx b/src/app/(application)/member/[id]/page.tsx new file mode 100644 index 0000000..c05ea29 --- /dev/null +++ b/src/app/(application)/member/[id]/page.tsx @@ -0,0 +1,10 @@ +import { ViewDetailMember } from "@/module/user/member"; + +function Page({ params }: { params: { id: string } }) { + return ( + + ) +} + +export default Page; + diff --git a/src/app/(application)/member/create/page.tsx b/src/app/(application)/member/create/page.tsx new file mode 100644 index 0000000..1afa674 --- /dev/null +++ b/src/app/(application)/member/create/page.tsx @@ -0,0 +1,9 @@ +import { ViewCreateMember } from "@/module/user/member"; + +function Page() { + return ( + + ); +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/member/page.tsx b/src/app/(application)/member/page.tsx new file mode 100644 index 0000000..8b49914 --- /dev/null +++ b/src/app/(application)/member/page.tsx @@ -0,0 +1,9 @@ +import { ViewListMember } from "@/module/user/member"; + +function Page() { + return ( + + ) +} + +export default Page; \ No newline at end of file diff --git a/src/app/(application)/notification/page.tsx b/src/app/(application)/notification/page.tsx new file mode 100644 index 0000000..67c880a --- /dev/null +++ b/src/app/(application)/notification/page.tsx @@ -0,0 +1,10 @@ +import { ViewNotification } from '@/module/notification'; +import React from 'react'; + +function Page() { + return ( + + ); +} + +export default Page; diff --git a/src/app/(application)/position/page.tsx b/src/app/(application)/position/page.tsx new file mode 100644 index 0000000..69da2f2 --- /dev/null +++ b/src/app/(application)/position/page.tsx @@ -0,0 +1,11 @@ +import React from 'react'; + +function Page() { + return ( +
+ Page +
+ ); +} + +export default Page; diff --git a/src/app/(application)/profile/edit/page.tsx b/src/app/(application)/profile/edit/page.tsx new file mode 100644 index 0000000..6ca9661 --- /dev/null +++ b/src/app/(application)/profile/edit/page.tsx @@ -0,0 +1,9 @@ +import { ViewEditProfile } from "@/module/user" + +function Page() { + return ( + + ) +} + +export default Page \ No newline at end of file diff --git a/src/app/(application)/project/page.tsx b/src/app/(application)/project/page.tsx new file mode 100644 index 0000000..af04bfb --- /dev/null +++ b/src/app/(application)/project/page.tsx @@ -0,0 +1,10 @@ +import { ViewProject } from '@/module/project'; +import React from 'react'; + +function Page() { + return ( + + ); +} + +export default Page; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ad01478..5b9582c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -32,8 +32,10 @@ export default function RootLayout({ - - + + {children} diff --git a/src/app/loading.tsx b/src/app/loading.tsx new file mode 100644 index 0000000..1123e45 --- /dev/null +++ b/src/app/loading.tsx @@ -0,0 +1,5 @@ +import { LoadingPage } from "@/module/_global"; + +export default function Loading() { + return +} \ No newline at end of file diff --git a/src/module/_global/fun/WARNA.ts b/src/module/_global/fun/WARNA.ts index a8d2c6c..38580ae 100644 --- a/src/module/_global/fun/WARNA.ts +++ b/src/module/_global/fun/WARNA.ts @@ -1,5 +1,6 @@ export const WARNA = { bgWhite: "#F4F9FD", biruTua: "#19345E", - bgIcon: "#384288" + bgIcon: "#384288", + borderOrange: "#FCAA4B" } \ No newline at end of file diff --git a/src/module/_global/index.ts b/src/module/_global/index.ts index 7c77fb9..0265e54 100644 --- a/src/module/_global/index.ts +++ b/src/module/_global/index.ts @@ -1,7 +1,15 @@ import { WARNA } from "./fun/WARNA"; +import LayoutDrawer from "./layout/layout_drawer"; +import LayoutIconBack from "./layout/layout_icon_back"; +import LoadingPage from "./layout/layout_loading_page"; import LayoutLogin from "./layout/layout_login"; import LayoutNavbarHome from "./layout/layout_navbar_home"; +import { isDrawer } from "./val/isDrawer"; export { WARNA } export { LayoutLogin } -export {LayoutNavbarHome} \ No newline at end of file +export { LayoutNavbarHome } +export { LayoutIconBack } +export { LoadingPage } +export { LayoutDrawer } +export { isDrawer } \ No newline at end of file diff --git a/src/module/_global/layout/layout_drawer.tsx b/src/module/_global/layout/layout_drawer.tsx new file mode 100644 index 0000000..62a997d --- /dev/null +++ b/src/module/_global/layout/layout_drawer.tsx @@ -0,0 +1,20 @@ +import { Box, Drawer, Text } from '@mantine/core'; +import React from 'react'; +import { WARNA } from '../fun/WARNA'; + +export default function LayoutDrawer({ opened, onClose, title, children }: { children: React.ReactNode, opened: boolean, onClose: () => void, title: React.ReactNode }) { + return ( + + {title}} onClose={onClose} position={"bottom"} size={"35%"} + styles={{ + content: { + backgroundColor: "white", + borderRadius: "20px 20px 0px 0px", + }, + }} + > + {children} + + + ); +} diff --git a/src/module/_global/layout/layout_icon_back.tsx b/src/module/_global/layout/layout_icon_back.tsx new file mode 100644 index 0000000..f3a6dc3 --- /dev/null +++ b/src/module/_global/layout/layout_icon_back.tsx @@ -0,0 +1,27 @@ +'use client' +import { ActionIcon, Box } from '@mantine/core'; +import { useRouter } from 'next/navigation'; +import React from 'react'; +import { HiChevronLeft } from 'react-icons/hi2'; +import { WARNA } from '../fun/WARNA'; +import _ from 'lodash'; + +function LayoutIconBack({ back }: { back?: string }) { + const router = useRouter() + return ( + + { + if (!_.isUndefined(back) && !_.isNull(back)) { + return router.push(back) + } else { + return router.back() + } + + }} bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings"> + + + + ); +} + +export default LayoutIconBack; diff --git a/src/module/_global/layout/layout_loading_page.tsx b/src/module/_global/layout/layout_loading_page.tsx new file mode 100644 index 0000000..2f30c25 --- /dev/null +++ b/src/module/_global/layout/layout_loading_page.tsx @@ -0,0 +1,33 @@ +import { Box, Group, Skeleton, Text } from "@mantine/core"; +import LayoutNavbarHome from "./layout_navbar_home"; + +export default function LoadingPage() { + return ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + ) +} \ No newline at end of file diff --git a/src/module/_global/layout/layout_navbar_home.tsx b/src/module/_global/layout/layout_navbar_home.tsx index 66d22c5..fa35cd1 100644 --- a/src/module/_global/layout/layout_navbar_home.tsx +++ b/src/module/_global/layout/layout_navbar_home.tsx @@ -4,16 +4,15 @@ import { WARNA } from '../fun/WARNA'; export const LayoutNavbarHome = ({ children }: { children: React.ReactNode }) => { return ( - <> - {children} - ); } export default LayoutNavbarHome \ No newline at end of file diff --git a/src/module/_global/val/isDrawer.ts b/src/module/_global/val/isDrawer.ts new file mode 100644 index 0000000..e8d4ad7 --- /dev/null +++ b/src/module/_global/val/isDrawer.ts @@ -0,0 +1,4 @@ +'use client' +import { hookstate } from '@hookstate/core'; + +export const isDrawer = hookstate(false) diff --git a/src/module/announcement/component/detail_announcement.tsx b/src/module/announcement/component/detail_announcement.tsx new file mode 100644 index 0000000..47b74ea --- /dev/null +++ b/src/module/announcement/component/detail_announcement.tsx @@ -0,0 +1,37 @@ +import { Box, Group, Stack, Text } from "@mantine/core"; +import { BsCardText } from "react-icons/bs"; +import { TfiAnnouncement } from "react-icons/tfi"; + +export default function DetailAnnouncement() { + return ( + + + + + + Pengumuman Dinas + + + + Pengumuman agar menggunakan + + + + + + Anggota + + LPD + + + PKK + + + Karang Taruna + + + + + + ) +} \ No newline at end of file diff --git a/src/module/announcement/component/list_announcement.tsx b/src/module/announcement/component/list_announcement.tsx new file mode 100644 index 0000000..c1317a6 --- /dev/null +++ b/src/module/announcement/component/list_announcement.tsx @@ -0,0 +1,92 @@ +'use client' +import { isDrawer, LayoutDrawer, WARNA } from '@/module/_global'; +import { ActionIcon, Anchor, Box, Group, Text, TextInput } from '@mantine/core'; +import React from 'react'; +import { TfiAnnouncement } from "react-icons/tfi"; +import { HiMagnifyingGlass } from 'react-icons/hi2'; +import { useRouter } from 'next/navigation'; + +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() { + const router = useRouter() + return ( + + } + placeholder="Pencarian" + /> + {dataPengumuman.map((v, i) => { + return ( + { + router.push(`/announcement/${v.id}`) + }}> + + + + + + + + {v.name} + + + + ) + })} + + ); +} diff --git a/src/module/announcement/component/ui/drawer_announcement.tsx b/src/module/announcement/component/ui/drawer_announcement.tsx new file mode 100644 index 0000000..7eccd40 --- /dev/null +++ b/src/module/announcement/component/ui/drawer_announcement.tsx @@ -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 ( + + + + { + router.push('/announcement/create') + onCLose() + }} + > + + + + + Tambah Pengumuman + + + + + + + + + Filter + + + + + + ); +} diff --git a/src/module/announcement/component/ui/drawer_detail_announcement.tsx b/src/module/announcement/component/ui/drawer_detail_announcement.tsx new file mode 100644 index 0000000..71824e5 --- /dev/null +++ b/src/module/announcement/component/ui/drawer_detail_announcement.tsx @@ -0,0 +1,45 @@ +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 { FaPencil, FaTrash } from 'react-icons/fa6'; + +export default function DrawerDetailAnnouncement() { + const openDrawer = useHookstate(isDrawer) + const router = useRouter() + + function onCLose() { + openDrawer.set(false) + } + return ( + + + + + + + + + Hapus + + + + { + router.push('edit/123') + onCLose() + }}> + + + + + Edit + + + + + + ); +} diff --git a/src/module/announcement/component/ui/navbar_announcement.tsx b/src/module/announcement/component/ui/navbar_announcement.tsx new file mode 100644 index 0000000..782be67 --- /dev/null +++ b/src/module/announcement/component/ui/navbar_announcement.tsx @@ -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 ( + <> + + + + + + + PENGUMUMAN + + + + openDrawer.set(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings"> + + + + + + + openDrawer.set(false)}> + + + + ); +} + diff --git a/src/module/announcement/component/ui/navbar_create_announcement.tsx b/src/module/announcement/component/ui/navbar_create_announcement.tsx new file mode 100644 index 0000000..cb25c3e --- /dev/null +++ b/src/module/announcement/component/ui/navbar_create_announcement.tsx @@ -0,0 +1,21 @@ +'use client' +import { LayoutIconBack, LayoutNavbarHome } from "@/module/_global"; +import { Box, Grid, Text } from "@mantine/core"; + +export default function NavbarCreateAnnouncement() { + return ( + + + + + + + + Tambah Pengumuman + + + + + + ) +} \ No newline at end of file diff --git a/src/module/announcement/component/ui/navbar_detail_announcement.tsx b/src/module/announcement/component/ui/navbar_detail_announcement.tsx new file mode 100644 index 0000000..a2584ae --- /dev/null +++ b/src/module/announcement/component/ui/navbar_detail_announcement.tsx @@ -0,0 +1,34 @@ +'use client' +import { isDrawer, LayoutDrawer, LayoutIconBack, LayoutNavbarHome, WARNA } from "@/module/_global"; +import { useHookstate } from "@hookstate/core"; +import { ActionIcon, Box, Grid, Group, Text } from "@mantine/core"; +import { HiMenu } from "react-icons/hi"; +import DrawerDetailAnnouncement from "./drawer_detail_announcement"; + +export default function NavbarDetailAnnouncement() { + const openDrawer = useHookstate(isDrawer) + return ( + + + + + + + + PENGUMUMAN + + + + openDrawer.set(true)} variant="light" bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings"> + + + + + + + openDrawer.set(false)}> + + + + ) +} \ No newline at end of file diff --git a/src/module/announcement/component/ui/navbar_edit_announcement.tsx b/src/module/announcement/component/ui/navbar_edit_announcement.tsx new file mode 100644 index 0000000..3add416 --- /dev/null +++ b/src/module/announcement/component/ui/navbar_edit_announcement.tsx @@ -0,0 +1,21 @@ +'use client' +import { LayoutIconBack, LayoutNavbarHome } from "@/module/_global"; +import { Box, Grid, Text } from "@mantine/core"; + +export default function NavbarEditAnnouncement() { + return ( + + + + + + + + Edit Pengumuman + + + + + + ) +} \ No newline at end of file diff --git a/src/module/announcement/index.ts b/src/module/announcement/index.ts index e69de29..297f4d5 100644 --- a/src/module/announcement/index.ts +++ b/src/module/announcement/index.ts @@ -0,0 +1,9 @@ +import ViewCreateAnnouncement from "./view/view_create_announcement"; +import ViewDetailAnnouncement from "./view/view_detail_anouncement"; +import ViewEditAnnouncement from "./view/view_edit_announcement"; +import ViewListAnnouncement from "./view/view_list_announcement"; + +export { ViewListAnnouncement } +export { ViewCreateAnnouncement } +export { ViewDetailAnnouncement } +export { ViewEditAnnouncement } \ No newline at end of file diff --git a/src/module/announcement/view/view_create_announcement.tsx b/src/module/announcement/view/view_create_announcement.tsx new file mode 100644 index 0000000..4774ad5 --- /dev/null +++ b/src/module/announcement/view/view_create_announcement.tsx @@ -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 ( + + + + +