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 03:34
Code snippets 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 / importApp.js
Created May 30, 2017 03:39
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# index.ios.js and index.android.js
import './App.js'
@ridgeO
ridgeO / initialApp.js
Created May 30, 2017 03:40
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
# App.js
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
Text
} from 'react-native';
@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'
@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 / 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 / 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 / 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 / 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 / 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}>