Last active
January 29, 2016 15:26
-
-
Save slamus/7fa0f26eb511ee3ea3ec to your computer and use it in GitHub Desktop.
Responsive Design in React Native - Component
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
"use strict" | |
import React from "react-native"; | |
// We Import our Stylesheet | |
import Style from "./Style"; | |
const { | |
View, | |
Text, | |
StyleSheet, | |
Component, | |
} = React; | |
class Card extends Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text style={styles.text}> | |
{this.props.children} | |
</Text> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
width: Style.CARD_WIDTH, | |
height: Style.CARD_HEIGHT, | |
padding: Style.CARD_PADDING_X, | |
paddingTop: Style.CARD_PADDING_Y, | |
paddingBottom: Style.CARD_PADDING_Y, | |
}, | |
text: { | |
fontSize: Style.FONT_SIZE, | |
lineHeight: Style.FONT_SIZE * 1.5, | |
}, | |
}) | |
export default Card; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
paddingHorizontal / paddingVertical, maybe?