Created
February 13, 2018 14:50
-
-
Save longsangstan/18b70194cd41454157496bf181d55575 to your computer and use it in GitHub Desktop.
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
//// | |
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