From 7e828a7ad91989bc1832160c9a7f7b7159d51458 Mon Sep 17 00:00:00 2001 From: amel Date: Thu, 20 Mar 2025 14:23:22 +0800 Subject: [PATCH] upd: dokumen divisi - Deskripsi: - share dokumen divisi - ui modal share dokumen diviis No Issues --- .../document/menuBottomSelectDocument.tsx | 10 +++- components/modalSelectMultiple.tsx | 50 +++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 components/modalSelectMultiple.tsx diff --git a/components/document/menuBottomSelectDocument.tsx b/components/document/menuBottomSelectDocument.tsx index df30a8c..05c51fa 100644 --- a/components/document/menuBottomSelectDocument.tsx +++ b/components/document/menuBottomSelectDocument.tsx @@ -11,6 +11,7 @@ import ItemAccordion from "../itemAccordion"; import ItemDetailMember from "../itemDetailMember"; import MenuItemRow from "../menuItemRow"; import ModalFloat from "../modalFloat"; +import ModalSelectMultiple from "../modalSelectMultiple"; type Props = { @@ -21,6 +22,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) { const [isModal, setModal] = useState(false) const [isInformasi, setInformasi] = useState(false) const [isRename, setRename] = useState(false) + const [isShare, setShare] = useState(false) const open = useSharedValue(false) const onPress = () => { @@ -66,7 +68,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) { } title="Bagikan" - onPress={() => { }} + onPress={() => { setShare(true) }} column="many" color="white" /> @@ -190,6 +192,12 @@ export default function MenuBottomSelectDocument({ onDone }: Props) { + + { + ToastAndroid.show('Success', ToastAndroid.SHORT) + setShare(false) + }} /> ) } \ No newline at end of file diff --git a/components/modalSelectMultiple.tsx b/components/modalSelectMultiple.tsx new file mode 100644 index 0000000..08c722a --- /dev/null +++ b/components/modalSelectMultiple.tsx @@ -0,0 +1,50 @@ +import Styles from "@/constants/Styles" +import { AntDesign } from "@expo/vector-icons" +import { useState } from "react" +import { Pressable, Text, View } from "react-native" +import { ButtonForm } from "./buttonForm" +import DrawerBottom from "./drawerBottom" + +type Props = { + open: boolean + close: (value: boolean) => void + title: string + category: 'share-division' | 'status-task' + choose: string + onSelect: (value: { val: string, label: string }[]) => void +} + +export default function ModalSelectMultiple({ open, close, title, category, choose, onSelect }: Props) { + const [isChoose, setChoose] = useState(choose) + + return ( + + + { + category == 'share-division' ? + <> + { + setChoose('dinas') + close(false) + }}> + Sosial Kemasyarakatan + + + + Kaur Pemerintahan + + + Kasi Kemasyarakatan + + + PKK + + + : + <> + } + + { onSelect([{ val: 'dinas', label: 'Dinas' }]) }} /> + + ) +} \ No newline at end of file