Created
July 6, 2016 03:46
-
-
Save josephan/3b73f894ebe10244e2cd6b1315ac65d8 to your computer and use it in GitHub Desktop.
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
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* @flow | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
Image, | |
View | |
} from 'react-native'; | |
var MOCKED_MOVIES_DATA = [ | |
{title: 'Title', year: '2015', posters: {thumbnail: 'http://i.imgur.com/UePbdph.jpg'}}, | |
]; | |
class SampleAppMovie extends Component { | |
render() { | |
var movie = MOCKED_MOVIES_DATA[0]; | |
return ( | |
<View style={styles.container}> | |
<Text>{movie.title}</Text> | |
<Text>{movie.year}</Text> | |
<Image | |
source={{uri: movie.posters.thumbnail}} | |
style={styles.thumbnail} | |
/> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
justifyContent: 'center', | |
alignItems: 'center', | |
backgroundColor: '#F5FCFF', | |
}, | |
thumbnail: { | |
width: 53, | |
height: 81, | |
}, | |
}); | |
AppRegistry.registerComponent('SampleAppMovie', () => SampleAppMovie); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment