Created
June 6, 2019 15:53
-
-
Save lukebrandonfarrell/93e14d7551e3d66cb2d39ed80d3947d6 to your computer and use it in GitHub Desktop.
<Alert /> component styled at isolated level.
This file contains hidden or 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 React from "react"; | |
import { View, Text } from "react-native"; | |
const Alert = ({ title, text, backgroundColor, borderColor, titleColor, descriptionColor }) => { | |
return ( | |
<ThemeContext.Consumer> | |
{theme => ( | |
<View style={[ | |
..., | |
{ | |
backgroundColor: backgroundColor, | |
borderColor: borderColor | |
} | |
]}> | |
<Text style={[..., { color: titleColor }]}> {title} </Text> | |
<Text style={[..., { color: descriptionColor }]}> {text} </Text> | |
</View> | |
</ThemeContext.Consumer> | |
); | |
}; | |
export default Alert; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment