|
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}/> |
|
), |
|
}) |
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
) |