mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-25 22:33:52 +03:00
Fixed auto navigate action for tabbar
This commit is contained in:
parent
a927c70f77
commit
7ca33bfb70
@ -2,15 +2,10 @@ import EStyleSheet from 'react-native-extended-stylesheet';
|
|||||||
|
|
||||||
export default EStyleSheet.create({
|
export default EStyleSheet.create({
|
||||||
wrapper: {
|
wrapper: {
|
||||||
flexDirection: 'row',
|
|
||||||
height: 56,
|
|
||||||
width: '$deviceWidth',
|
width: '$deviceWidth',
|
||||||
backgroundColor: '$primaryBackgroundColor',
|
position: 'absolute',
|
||||||
borderTopWidth: 0.1,
|
bottom: 0,
|
||||||
shadowOpacity: 0.1,
|
left: 0,
|
||||||
elevation: 10,
|
zIndex: 99999,
|
||||||
},
|
|
||||||
safeArea: {
|
|
||||||
backgroundColor: '$primaryBackgroundColor',
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -71,20 +71,12 @@ class BottomTabBarView extends PureComponent {
|
|||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView
|
<SafeAreaView style={styles.wrapper}>
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
zIndex: 99999,
|
|
||||||
width: Dimensions.get('window').width,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<TabBar
|
<TabBar
|
||||||
selectedIndex={0}
|
selectedIndex={index}
|
||||||
circleBackgroundColor="#357ce6"
|
circleBackgroundColor="#357ce6"
|
||||||
backgroundColor="#f6f6f6"
|
backgroundColor="#f6f6f6"
|
||||||
onChange={index => this._jumpTo(routes[index])}
|
onChange={i => this._jumpTo(routes[i])}
|
||||||
activeTintColor={activeTintColor}
|
activeTintColor={activeTintColor}
|
||||||
inactiveTintColor={inactiveTintColor}
|
inactiveTintColor={inactiveTintColor}
|
||||||
>
|
>
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import { StyleSheet, View, TouchableHighlight, Animated, Dimensions } from 'react-native';
|
||||||
StyleSheet,
|
|
||||||
View,
|
|
||||||
TouchableHighlight,
|
|
||||||
Animated,
|
|
||||||
Dimensions,
|
|
||||||
SafeAreaView,
|
|
||||||
} from 'react-native';
|
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import Svg, { Circle, Path } from 'react-native-svg';
|
import Svg, { Circle, Path } from 'react-native-svg';
|
||||||
|
|
||||||
@ -58,6 +51,14 @@ export default class TabBar extends Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate(prevProps) {
|
||||||
|
const { selectedIndex } = this.props;
|
||||||
|
|
||||||
|
if (prevProps.selectedIndex !== selectedIndex) {
|
||||||
|
this._onPress(selectedIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_onPress = (i, disabled) => {
|
_onPress = (i, disabled) => {
|
||||||
const { onChange } = this.props;
|
const { onChange } = this.props;
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
|
Loading…
Reference in New Issue
Block a user