Skip to content

Instantly share code, notes, and snippets.

@lukebrandonfarrell
Created June 6, 2019 15:53
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 lukebrandonfarrell/50af6ccec474b0a671b10d2b5a999899 to your computer and use it in GitHub Desktop.
Save lukebrandonfarrell/50af6ccec474b0a671b10d2b5a999899 to your computer and use it in GitHub Desktop.
<Alert /> component styled at specialized level.
import React from "react";
import { View, Text } from "react-native";
const Alert = ({ title, text }) => {
return (
<ThemeContext.Consumer>
{theme => (
<View style={[
...,
{
backgroundColor: "#fdd5d3",
borderColor: "#fc9e97"
}
]}>
<Text style={[..., { color: "#a4150b" }]}> {title} </Text>
<Text style={[..., { color: "#a4150b" }]}> {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