Deskripsi: - list data lembaga desa - tambah data lembaga desa - edit data lembaga desa - pencarian data lembaga desa - delete data lembaga desa No Issues
58 lines
2.1 KiB
TypeScript
58 lines
2.1 KiB
TypeScript
import Styles from "@/constants/Styles"
|
|
import { MaterialIcons } from "@expo/vector-icons"
|
|
import { Pressable, Text, View } from "react-native"
|
|
import Modal from 'react-native-modal';
|
|
|
|
type Props = {
|
|
isVisible: boolean
|
|
setVisible: (value: boolean) => void
|
|
title?: string
|
|
children: React.ReactNode
|
|
animation?: 'slide' | 'none' | 'fade'
|
|
height?: number
|
|
}
|
|
|
|
export default function DrawerBottom({ isVisible, setVisible, title, children, animation, height }: Props) {
|
|
return (
|
|
// <Modal
|
|
// animationType={animation}
|
|
// transparent={true} visible={isVisible}>
|
|
// <View style={[Styles.modalBgTransparant]}>
|
|
// <View style={[Styles.modalContent, height != undefined && { height: `${height}%` }]}>
|
|
// <View style={Styles.titleContainer}>
|
|
// <Text style={Styles.textDefault}>{title}</Text>
|
|
// <Pressable onPress={() => setVisible(false)}>
|
|
// <MaterialIcons name="close" color="black" size={22} />
|
|
// </Pressable>
|
|
// </View>
|
|
// <View style={Styles.contentContainer}>
|
|
// {children}
|
|
// </View>
|
|
// </View>
|
|
// </View>
|
|
// </Modal>
|
|
|
|
<Modal
|
|
animationIn={"slideInUp"}
|
|
animationOut={"slideOutDown"}
|
|
isVisible={isVisible}
|
|
onSwipeComplete={() => setVisible(false)}
|
|
swipeDirection="down"
|
|
hideModalContentWhileAnimating={true}
|
|
// onBackdropPress={() => { setVisible(true) }}
|
|
style={[{ justifyContent: 'flex-end', margin: 0 }]}
|
|
>
|
|
<View style={[Styles.modalContentNew, height != undefined ? { height: `${height}%` } : { height: '25%' }]}>
|
|
<View style={[Styles.titleContainerNew]}>
|
|
<Text style={Styles.textDefault}>{title}</Text>
|
|
<Pressable onPress={() => setVisible(false)}>
|
|
<MaterialIcons name="close" color="black" size={22} />
|
|
</Pressable>
|
|
</View>
|
|
<View style={Styles.contentContainer}>
|
|
{children}
|
|
</View>
|
|
</View>
|
|
</Modal>
|
|
)
|
|
} |