Skip to content

Instantly share code, notes, and snippets.

View ridgeO's full-sized avatar

Ridge ridgeO

View GitHub Profile
@ridgeO
ridgeO / addBackButtonToRed.js
Created May 30, 2017 04:15
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
class RedScreen extends Component {
render() {
return(
<View style={styles.red}>
<Text style={styles.text}>This is the Red Screen</Text>
<TouchableHighlight
style={styles.button}
@ridgeO
ridgeO / addButtonToStyles.js
Created May 30, 2017 03:58
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# Styles.js
...
button: {
backgroundColor: '#1E90FF',
padding: 20,
borderRadius: 8,
marginTop: 20
}
...
@ridgeO
ridgeO / addTouchableHighlightToGreen.js
Created May 30, 2017 03:57
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
import {
...
TouchableHighlight
} from 'react-native';
...
class GreenScreen extends Component {
@ridgeO
ridgeO / addHeaderTitles.js
Created May 30, 2017 03:51
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
class GreenScreen extends Component {
static navigationOptions = {
title: 'Green'
}
render() {
return(
<View style={styles.green}>
@ridgeO
ridgeO / renderStackNav.js
Created May 30, 2017 03:50
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
class ReactNav extends Component {
render() {
return (
<StackNav/>
);
}
}
@ridgeO
ridgeO / createStackNav.js
Created May 30, 2017 03:49
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
const StackNav = StackNavigator({
Green: { screen: GreenScreen },
Red: { screen: RedScreen },
Blue: { screen: BlueScreen },
Purple: { screen: PurpleScreen }
})
...
@ridgeO
ridgeO / importStackNavigator.js
Created May 30, 2017 03:48
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
import { StackNavigator } from 'react-navigation';
...
@ridgeO
ridgeO / colorStyles.js
Created May 30, 2017 03:45
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# Styles.js
...
green: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: 'green'
},
red: {
@ridgeO
ridgeO / initialColorScreens.js
Created May 30, 2017 03:44
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
...
class GreenScreen extends Component {
render() {
return(
<View style={styles.green}>
<Text style={styles.text}>This is the Green Screen</Text>
</View>
);
@ridgeO
ridgeO / initialStyles.js
Created May 30, 2017 03:41
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# Styles.js
'use strict';
import { StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center'