Skip to content

Instantly share code, notes, and snippets.

@longsangstan
Created February 13, 2018 14:50
Show Gist options
  • Save longsangstan/18b70194cd41454157496bf181d55575 to your computer and use it in GitHub Desktop.
Save longsangstan/18b70194cd41454157496bf181d55575 to your computer and use it in GitHub Desktop.
////
import Modal from "react-native-modalbox";
const { width, height } = Dimensions.get("window");
////
renderModal = () => {
let marginTop = height / 2 - 20;
let BackgroundView = Platform.OS === "ios" ? BlurView : View;
return (
<Modal
style={{
backgroundColor:
Platform.OS === "ios" ? "transparent" : "white",
marginTop: marginTop
}}
ref={ref => (this.modal = ref)}
coverScreen={true}
swipeArea={marginTop + 30}
backdropOpacity={0.0}
backdropPressToClose={true}
swipeToClose={true}
>
<BackgroundView
style={{
flex: 1,
borderRadius: 12,
paddingBottom: marginTop,
justifyContent: "center",
alignItems: "center"
}}
intensity={100}
>
<Text>ABCDEF</Text>
</BackgroundView>
</Modal>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment