- modal component

This commit is contained in:
2020-05-19 00:48:11 -04:00
parent ee051f604e
commit e0dd85153c

35
app/screens/Modal.js Normal file
View File

@@ -0,0 +1,35 @@
import PropTypes from 'prop-types';
import React from 'react';
import { StyleSheet, Button, View } from 'react-native';
const Modal = ({ children, navigation, title }) => (
<View style={styles.container}>
<Button onPress={() => navigation.goBack()} title="Dismiss" />
{children}
</View>
);
Modal.propTypes = {
children: PropTypes.node.isRequired,
title: PropTypes.string,
};
Modal.defaultPorps = {
title: null,
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
title: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});
export default Modal;