| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import React from 'react';
- import { StyleSheet, View } from 'react-native';
- import Modal from 'react-native-modal';
- export const ModalProps = {
- avoidKeyboard: true,
- animationIn: "fadeIn",
- animationOut: "fadeOut",
- propagateSwipe: true,
- useNativeDriver: !isIOS,
- hideModalContentWhileAnimating: true
- }
- export default BottomModal = ({
- visible=false,
- onHide,
- children,
- backdropOpacity=0.7,
- style=styles.bottomModalView,
- contentStyle=styles.bottomModalContent}) => {
- return (
- <Modal
- isVisible={visible}
- onBackButtonPress={onHide}
- onBackdropPress={onHide}
- useNativeDriver={!isIOS}
- backdropOpacity={backdropOpacity}
- style={style}>
- <View style={contentStyle}>
- {children}
- </View>
- </Modal>
- );
- }
- const styles = StyleSheet.create({
- bottomModalView: {
- margin: 0,
- justifyContent: 'flex-end'
- },
- bottomModalContent: {
- maxHeight: $vht(isIOS ? 92 : 96),
- backgroundColor: pageBackground,
- ...$borderRadius(20, 20, 0, 0)
- },
- })
|