Skip to content

Instantly share code, notes, and snippets.

@slamus
Last active January 29, 2016 15:26
Show Gist options
  • Save slamus/7fa0f26eb511ee3ea3ec to your computer and use it in GitHub Desktop.
Save slamus/7fa0f26eb511ee3ea3ec to your computer and use it in GitHub Desktop.
Responsive Design in React Native - Component
"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;
Copy link

ghost commented Jan 29, 2016

paddingHorizontal / paddingVertical, maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment