Last active
August 29, 2015 14:14
-
-
Save reactnative/122e5b0063f2311303e7 to your computer and use it in GitHub Desktop.
ReactJSConf snippets
This file contains 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
//[...] | |
var getImageSource = require('./getImageSource'); | |
var MovieCell = React.createClass({ | |
render: function() { | |
return ( | |
<View> | |
<TouchableHighlight onPress={this.props.onselect}> | |
<View style={styles.row}> | |
<Image | |
source={getImageSource(this.props.movie, 'det')} | |
style={styles.cellImage} | |
/> | |
<View style={styles.textContainer}> | |
<Text style={styles.movieTitle} numberOfLines={2}> | |
{this.props.movie.title} | |
</Text> | |
<Text style={styles.movieYear} numberOfLines={1}> | |
{this.props.movie.year} | |
</Text> | |
</View> | |
</View> | |
</TouchableHighlight> | |
<View style={styles.cellBorder} /> | |
</View> | |
); | |
} | |
}); |
This file contains 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
//[...] | |
var MoviesApp = React.createClass({ | |
render: function() { | |
return ( | |
<NavigatorIOS | |
style={styles.container} | |
initialRoute={{title: 'Movies', component: <SearchScreen >}} | |
routeMapper={MoviesRouteMapper} | |
/> | |
); | |
} | |
});` | |
`var styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
backgroundColor: 'white', | |
} | |
}); | |
module.exports = MoviesApp; |
This file contains 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
#import "RKView.h" | |
#import <UiKit/UIKit.h> | |
#import <FBReactKit/UIView+FBReactKit.h> | |
#import "UIView+FBReactKit.h" | |
@interface RKView : UIView |
This file contains 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
var styles = { | |
movieTitle: { | |
flex: 1, | |
fontSize: 16, | |
fontWeight: 'bold', | |
marginBottom: 2, | |
}, | |
movieYear: { | |
color: '#999999', | |
fontSize: 12 | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment