- modal component
This commit is contained in:
35
app/screens/Modal.js
Normal file
35
app/screens/Modal.js
Normal 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;
|
||||
Reference in New Issue
Block a user