Skip to content

Commit

Permalink
step2 the minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
GantMan committed Aug 28, 2017
1 parent 66d94e5 commit baca459
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 41 deletions.
9 changes: 0 additions & 9 deletions Containers/Screen1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ import React from 'react'
import { StyleSheet, Text, View, Image } from 'react-native'

export default class Screen1 extends React.Component {
static navigationOptions = {
drawerLabel: 'Screen One',
drawerIcon: () => (
<Image
source={{uri: `https://dummyimage.com/60x60/000/fff.jpg&text=1`}}
style={{width: 30, height: 30, borderRadius: 15}}
/>
)
}

render() {
return (
Expand Down
9 changes: 0 additions & 9 deletions Containers/Screen2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ import React from 'react'
import { StyleSheet, Text, View, Image } from 'react-native'

export default class Screen2 extends React.Component {
static navigationOptions = {
drawerLabel: 'Screen Two',
drawerIcon: () => (
<Image
source={{uri: `https://dummyimage.com/60x60/000/fff.jpg&text=2`}}
style={{width: 30, height: 30, borderRadius: 15}}
/>
)
}

render() {
return (
Expand Down
9 changes: 0 additions & 9 deletions Containers/Screen3.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ import React from 'react'
import { StyleSheet, Text, View, Image } from 'react-native'

export default class Screen3 extends React.Component {
static navigationOptions = {
drawerLabel: 'Screen Three',
drawerIcon: () => (
<Image
source={{uri: `https://dummyimage.com/60x60/000/fff.jpg&text=3`}}
style={{width: 30, height: 30, borderRadius: 15}}
/>
)
}

render() {
return (
Expand Down
16 changes: 2 additions & 14 deletions Navigation/AppNavigation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import { Text, Animated, Easing } from 'react-native'
import { Text } from 'react-native'
import { StackNavigator, DrawerNavigator } from 'react-navigation'
import LoginScreen from '../Containers/LoginScreen'
import SignupScreen from '../Containers/SignupScreen'
Expand All @@ -8,22 +8,12 @@ import Screen1 from '../Containers/Screen1'
import Screen2 from '../Containers/Screen2'
import Screen3 from '../Containers/Screen3'

// https://github.com/react-community/react-navigation/issues/1254
const noTransitionConfig = () => ({
transitionSpec: {
duration: 0,
timing: Animated.timing,
easing: Easing.step0
}
})

// drawer stack
const DrawerStack = DrawerNavigator({
screen1: { screen: Screen1 },
screen2: { screen: Screen2 },
screen3: { screen: Screen3 },
}, {
gesturesEnabled: false
})

const DrawerNavigation = StackNavigator({
Expand All @@ -33,7 +23,6 @@ const DrawerNavigation = StackNavigator({
navigationOptions: ({navigation}) => ({
headerStyle: {backgroundColor: 'green'},
title: 'Logged In to your app!',
gesturesEnabled: false,
headerLeft: <Text onPress={() => navigation.navigate('DrawerOpen')}>Menu</Text>
})
})
Expand All @@ -59,8 +48,7 @@ const PrimaryNav = StackNavigator({
// Default config for all screens
headerMode: 'none',
title: 'Main',
initialRouteName: 'loginStack',
transitionConfig: noTransitionConfig
initialRouteName: 'loginStack'
})

export default PrimaryNav

0 comments on commit baca459

Please sign in to comment.