Skip to content

Instantly share code, notes, and snippets.

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 mcavaliere/a519fafb2425edcd4b5e23562c987bb7 to your computer and use it in GitHub Desktop.
Save mcavaliere/a519fafb2425edcd4b5e23562c987bb7 to your computer and use it in GitHub Desktop.
React Native Design Systems: SimpleComponentWithoutLiterals
let Style = StyleSheet.create({
container: { borderRadius: 5 },
heading: { backgroundColor: 'beige', padding: 5 },
headingText: { color: 'black', fontSize: 16, fontWeight: 'bold' },
body: { padding: 5 },
bodyText: { color: 'black', fontSize: 12 }
})
class SimpleComponentWithoutLiterals extends Component {
render() {
return (
<View style={ Styles.container }>
<View style={ Styles.heading }>
<Text style={ Styles.headingText }>{ this.props.title }</Text>
</View>
<View style={ Styles.body }>
<Text style={ Styles.bodyText }>{ this.props.bodyText }</Text>
</View>
</View>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment