Instantly share code, notes, and snippets.
Often found playing around with Ruby on Rails, JQuery, Python, PostgreSQL, React, and React Native, among others. Currently at @ThePlatypusCompany
ridgeO
/ createNestedNavStack.js
Created
May 30, 2017 05:08
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
const NestedNav = StackNavigator( | |
{ | |
Landing: { screen: GreenScreen }, | |
Drawer: { screen: DrawerNavigator() } | |
}, | |
{ headerMode: 'none' } | |
) |
ridgeO
/ addDrawerOpenButtons.js
Created
May 30, 2017 04:54
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
class GreenScreen extends Component { | |
render() { | |
return( | |
.... | |
<TouchableHighlight | |
style={styles.button} | |
onPress={() => this.props.navigation.navigate('DrawerOpen')} |
ridgeO
/ addDrawerNavToApp.js
Created
May 30, 2017 04:44
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
class ReactNav extends Component { | |
render() { | |
return ( | |
<DrawerNav/> | |
); | |
} | |
} |
ridgeO
/ createDrawerNav.js
Created
May 30, 2017 04:43
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
const DrawerNav = DrawerNavigator({ | |
Green: { screen: GreenScreen }, | |
Red: { screen: RedScreen }, | |
Blue: { screen: BlueScreen }, | |
Purple: { screen: PurpleScreen } | |
}) | |
... |
ridgeO
/ importDrawerNavigator.js
Created
May 30, 2017 04:42
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
import { StackNavigator, TabNavigator, DrawerNavigator } from 'react-navigation'; | |
... |
ridgeO
/ addTabNavToApp.js
Created
May 30, 2017 04:35
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
class ReactNav extends Component { | |
render() { | |
return ( | |
<TabNav/> | |
); | |
} | |
} |
ridgeO
/ createTabNav.js
Created
May 30, 2017 04:32
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
const TabNav = TabNavigator( | |
{ | |
Green: { screen: GreenScreen }, | |
Red: { screen: RedScreen }, | |
Blue: { screen: BlueScreen }, | |
Purple: { screen: PurpleScreen } | |
}, |
ridgeO
/ importTabNavigator.js
Created
May 30, 2017 04:30
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
import { StackNavigator, TabNavigator } from 'react-navigation'; | |
... |
ridgeO
/ importButton.js
Created
May 30, 2017 04:22
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
import { | |
... | |
Button | |
} from 'react-native'; | |
... |
ridgeO
/ redScreenNavOptions.js
Last active
May 30, 2017 05:35
Code snippet from ReactNav application as featured in http://platypus.is/posts/4
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
# App.js | |
... | |
RedScreen.navigationOptions = props => { | |
const { navigation } = props; | |
return { | |
headerTitle: 'Red', | |
headerRight: (<Button title='Purple' onPress={() => navigation.navigate('Purple')}/>), | |
headerLeft: (<Button title='Blue' onPress={() => navigation.navigate('Blue')}/>) | |
} |