upd: dokumen divisi
- Deskripsi: - share dokumen divisi - ui modal share dokumen diviis No Issues
This commit is contained in:
@@ -11,6 +11,7 @@ import ItemAccordion from "../itemAccordion";
|
|||||||
import ItemDetailMember from "../itemDetailMember";
|
import ItemDetailMember from "../itemDetailMember";
|
||||||
import MenuItemRow from "../menuItemRow";
|
import MenuItemRow from "../menuItemRow";
|
||||||
import ModalFloat from "../modalFloat";
|
import ModalFloat from "../modalFloat";
|
||||||
|
import ModalSelectMultiple from "../modalSelectMultiple";
|
||||||
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -21,6 +22,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
|||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
const [isInformasi, setInformasi] = useState(false)
|
const [isInformasi, setInformasi] = useState(false)
|
||||||
const [isRename, setRename] = useState(false)
|
const [isRename, setRename] = useState(false)
|
||||||
|
const [isShare, setShare] = useState(false)
|
||||||
const open = useSharedValue(false)
|
const open = useSharedValue(false)
|
||||||
|
|
||||||
const onPress = () => {
|
const onPress = () => {
|
||||||
@@ -66,7 +68,7 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
|||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<MaterialCommunityIcons name="share-variant-outline" color="white" size={25} />}
|
icon={<MaterialCommunityIcons name="share-variant-outline" color="white" size={25} />}
|
||||||
title="Bagikan"
|
title="Bagikan"
|
||||||
onPress={() => { }}
|
onPress={() => { setShare(true) }}
|
||||||
column="many"
|
column="many"
|
||||||
color="white"
|
color="white"
|
||||||
/>
|
/>
|
||||||
@@ -190,6 +192,12 @@ export default function MenuBottomSelectDocument({ onDone }: Props) {
|
|||||||
</ItemAccordion>
|
</ItemAccordion>
|
||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
|
|
||||||
|
<ModalSelectMultiple choose="dinas" title="Bagikan" category="share-division" open={isShare} close={setShare}
|
||||||
|
onSelect={() => {
|
||||||
|
ToastAndroid.show('Success', ToastAndroid.SHORT)
|
||||||
|
setShare(false)
|
||||||
|
}} />
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
50
components/modalSelectMultiple.tsx
Normal file
50
components/modalSelectMultiple.tsx
Normal file
@@ -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 (
|
||||||
|
<DrawerBottom animation="slide" isVisible={open} setVisible={close} title={title} height={75}>
|
||||||
|
<View>
|
||||||
|
{
|
||||||
|
category == 'share-division' ?
|
||||||
|
<>
|
||||||
|
<Pressable style={[Styles.itemSelectModal]} onPress={() => {
|
||||||
|
setChoose('dinas')
|
||||||
|
close(false)
|
||||||
|
}}>
|
||||||
|
<Text style={[Styles.textDefaultSemiBold]}>Sosial Kemasyarakatan</Text>
|
||||||
|
<AntDesign name="check" size={20} />
|
||||||
|
</Pressable>
|
||||||
|
<Pressable style={[Styles.itemSelectModal]}>
|
||||||
|
<Text>Kaur Pemerintahan</Text>
|
||||||
|
</Pressable>
|
||||||
|
<Pressable style={[Styles.itemSelectModal]}>
|
||||||
|
<Text>Kasi Kemasyarakatan</Text>
|
||||||
|
</Pressable>
|
||||||
|
<Pressable style={[Styles.itemSelectModal]}>
|
||||||
|
<Text>PKK</Text>
|
||||||
|
</Pressable>
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
<></>
|
||||||
|
}
|
||||||
|
</View>
|
||||||
|
<ButtonForm text="Simpan" onPress={() => { onSelect([{ val: 'dinas', label: 'Dinas' }]) }} />
|
||||||
|
</DrawerBottom>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user