Created
February 23, 2018 17:13
-
-
Save shawn-kb/fbc8840597d0d930a21cbe94c21a81b9 to your computer and use it in GitHub Desktop.
Revisions
-
skrite created this gist
Feb 23, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,66 @@ function backToSummary(){ console.log("running back to summary") const resetAction = NavigationActions.reset({ index: 0, actions: [NavigationActions.navigate({routeName: 'Main'})] }) this.props.navigation.dispatch(resetAction); } /* const HomeIconComponent = ({ navigation }) => ( <TouchableOpacity onPress={() => this.props.navigation.navigate('Main')}> <Icon/> </TouchableOpacity> ) */ const HomeIconComponent = ({ navigation }) => ( <TouchableOpacity onPress={backToSummary}> <Icon/> </TouchableOpacity> ) export default TabNavigator( { SiteDrawer: { screen: SiteDrawer, navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ tintColor, focused }) => ( <Ionicons focused={focused} color={tintColor} name={Platform.OS === 'ios' ? `ios-information-circle${focused ? '' : '-outline'}` : 'md-information-circle' } /> ), }) }, Control: { screen: SiteControlScreen, navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ tintColor, focused }) => ( <Ionicons focused={focused} color={tintColor} name={Platform.OS === 'ios' ? `ios-link${focused ? '' : '-outline'}` : 'md-link' } /> ), }) }, Pressure: { screen: SitePressureScreen, navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ tintColor, focused }) => ( <Ionicons focused={focused} color={tintColor} name={Platform.OS === 'ios' ? `ios-options${focused ? '' : '-outline'}` : 'md-options' } /> ), }) }, Home: { screen: HomeIconComponent, navigationOptions: ({ navigation }) => ({ tabBarIcon: ({ tintColor, focused }) => ( <HomeIconComponent color={tintColor} navigation={navigation} focused={focused}/> ), }) }, } )