From a6825e8147196ec133edc6c3276b1ef653a9381f Mon Sep 17 00:00:00 2001 From: amel Date: Thu, 20 Mar 2025 10:50:37 +0800 Subject: [PATCH 1/3] upd: hapus dokumen divisi --- .../[id]/(fitur-division)/document/index.tsx | 2 +- .../document/menuBottomSelectDocument.tsx | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/app/(application)/division/[id]/(fitur-division)/document/index.tsx b/app/(application)/division/[id]/(fitur-division)/document/index.tsx index b9b9687..1f66958 100644 --- a/app/(application)/division/[id]/(fitur-division)/document/index.tsx +++ b/app/(application)/division/[id]/(fitur-division)/document/index.tsx @@ -45,7 +45,7 @@ export default function DocumentDivision() { { - isChecked && + isChecked && { setIsChecked(false) }} /> } ) diff --git a/components/document/menuBottomSelectDocument.tsx b/components/document/menuBottomSelectDocument.tsx index dd07267..6236935 100644 --- a/components/document/menuBottomSelectDocument.tsx +++ b/components/document/menuBottomSelectDocument.tsx @@ -2,14 +2,20 @@ import { ColorsStatus } from "@/constants/ColorsStatus"; import Styles from "@/constants/Styles"; import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"; import { useState } from "react"; -import { Pressable, ScrollView, Text, View } from "react-native"; +import { Pressable, ScrollView, Text, ToastAndroid, View } from "react-native"; import { useSharedValue } from "react-native-reanimated"; +import AlertKonfirmasi from "../alertKonfirmasi"; import DrawerBottom from "../drawerBottom"; import ItemAccordion from "../itemAccordion"; import ItemDetailMember from "../itemDetailMember"; import MenuItemRow from "../menuItemRow"; -export default function MenuBottomSelectDocument() { + +type Props = { + onDone: () => void +} + +export default function MenuBottomSelectDocument({ onDone }: Props) { const [isModal, setModal] = useState(false) const [isInformasi, setInformasi] = useState(false) const open = useSharedValue(false) @@ -33,7 +39,17 @@ export default function MenuBottomSelectDocument() { } title="Hapus" - onPress={() => { }} + onPress={() => { + AlertKonfirmasi({ + title: 'Konfirmasi', + desc: 'Apakah anda yakin ingin menghapus data?', + + onPress: () => { + onDone() + ToastAndroid.show('Berhasil menghapus data', ToastAndroid.SHORT) + } + }) + }} column="many" color="white" /> From 2c24997f2d3e0994ef542cebaa0b6fb1cbcc3de8 Mon Sep 17 00:00:00 2001 From: amel Date: Thu, 20 Mar 2025 11:40:41 +0800 Subject: [PATCH 2/3] upd: dokumen divisi - rename file dokumen divisi - modal float No Issues --- .../document/menuBottomSelectDocument.tsx | 15 ++++++- components/modalFloat.tsx | 40 +++++++++++++++++++ constants/Styles.ts | 16 ++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 components/modalFloat.tsx diff --git a/components/document/menuBottomSelectDocument.tsx b/components/document/menuBottomSelectDocument.tsx index 6236935..df30a8c 100644 --- a/components/document/menuBottomSelectDocument.tsx +++ b/components/document/menuBottomSelectDocument.tsx @@ -6,9 +6,11 @@ import { Pressable, ScrollView, Text, ToastAndroid, View } from "react-native"; import { useSharedValue } from "react-native-reanimated"; import AlertKonfirmasi from "../alertKonfirmasi"; import DrawerBottom from "../drawerBottom"; +import { InputForm } from "../inputForm"; import ItemAccordion from "../itemAccordion"; import ItemDetailMember from "../itemDetailMember"; import MenuItemRow from "../menuItemRow"; +import ModalFloat from "../modalFloat"; type Props = { @@ -18,6 +20,7 @@ type Props = { export default function MenuBottomSelectDocument({ onDone }: Props) { const [isModal, setModal] = useState(false) const [isInformasi, setInformasi] = useState(false) + const [isRename, setRename] = useState(false) const open = useSharedValue(false) const onPress = () => { @@ -56,7 +59,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) { } title="Ganti Nama" - onPress={() => { }} + onPress={() => { setRename(true) }} column="many" color="white" /> @@ -77,6 +80,16 @@ export default function MenuBottomSelectDocument({ onDone }: Props) { + { + onDone() + ToastAndroid.show('Berhasil mengganti nama dokumen', ToastAndroid.SHORT) + }}> + + + + + void + title?: string + children: React.ReactNode + onSubmit: () => void +} + +export default function ModalFloat({ isVisible, setVisible, title, children, onSubmit }: Props) { + return ( + { setVisible(false) }} + > + + + {title} + + + {children} + + + { setVisible(false) }}> + Batal + + + Simpan + + + + + ) +} \ No newline at end of file diff --git a/constants/Styles.ts b/constants/Styles.ts index e9cb9b4..d14546c 100644 --- a/constants/Styles.ts +++ b/constants/Styles.ts @@ -137,6 +137,9 @@ const Styles = StyleSheet.create({ ph15: { paddingHorizontal: 15, }, + pv05: { + paddingVertical: 5 + }, pv10: { paddingVertical: 10 }, @@ -427,6 +430,19 @@ const Styles = StyleSheet.create({ justifyContent: 'space-between', paddingVertical: 10, }, + modalFloatContent: { + backgroundColor: 'white', + borderRadius: 18, + paddingTop: 5, + paddingBottom: 10, + paddingHorizontal: 20 + }, + titleContainerModalFloat: { + flexDirection: 'row', + alignItems: 'center', + justifyContent: 'center', + paddingVertical: 10, + }, wrapBtnTab: { justifyContent: 'space-between', flexDirection: 'row', From 7e828a7ad91989bc1832160c9a7f7b7159d51458 Mon Sep 17 00:00:00 2001 From: amel Date: Thu, 20 Mar 2025 14:23:22 +0800 Subject: [PATCH 3/3] 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