Skip to content

Instantly share code, notes, and snippets.

@m4har
Last active May 15, 2019 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4har/8c566b36f9cdd769c02d96d925bb03d3 to your computer and use it in GitHub Desktop.
Save m4har/8c566b36f9cdd769c02d96d925bb03d3 to your computer and use it in GitHub Desktop.
component Modal / Popup
// 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