Last active
May 15, 2019 14:56
-
-
Save m4har/8c566b36f9cdd769c02d96d925bb03d3 to your computer and use it in GitHub Desktop.
component Modal / Popup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// src/components/Modal/index.js | |
import React from "react"; | |
import { Modal, View } from "react-native"; | |
const ModalView = ({ visible, onDismiss, children, onRequestClose }) => ( | |
<Modal | |
visible={visible} | |
onDismiss={onDismiss} | |
transparent | |
animationType="fade" | |
onRequestClose={onRequestClose} | |
> | |
<View | |
style={{ | |
flex: 1, | |
backgroundColor: "rgba(0,0,0,0.3)", | |
justifyContent: "center", | |
alignItems: "center" | |
}} | |
> | |
{children} | |
</View> | |
</Modal> | |
); | |
export default ModalView; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment