| 123456789101112131415161718192021222324252627282930313233343536373839 |
- 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}) => {
- return (
- <Modal
- isVisible={visible}
- onBackButtonPress={onHide}
- onBackdropPress={onHide}
- useNativeDriver={!isIOS}
- style={styles.bottomModalView}>
- <View style={styles.bottomModalContent}>
- {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)
- },
- })
|