|
@@ -3,8 +3,6 @@ import {withTheme} from 'react-native-paper';
|
3
|
3
|
import TabIcon from "./TabIcon";
|
4
|
4
|
import TabHomeIcon from "./TabHomeIcon";
|
5
|
5
|
import {Animated} from 'react-native';
|
6
|
|
-import {withSafeArea} from "../../utils/withSafeArea";
|
7
|
|
-import {EdgeInsets} from "react-native-safe-area-context";
|
8
|
6
|
|
9
|
7
|
type Props = {
|
10
|
8
|
state: Object,
|
|
@@ -12,7 +10,6 @@ type Props = {
|
12
|
10
|
navigation: Object,
|
13
|
11
|
theme: Object,
|
14
|
12
|
collapsibleStack: Object,
|
15
|
|
- safeArea: EdgeInsets
|
16
|
13
|
}
|
17
|
14
|
|
18
|
15
|
type State = {
|
|
@@ -130,24 +127,23 @@ class CustomTabBar extends React.Component<Props, State> {
|
130
|
127
|
render() {
|
131
|
128
|
this.props.navigation.addListener('state', this.onRouteChange);
|
132
|
129
|
return (
|
133
|
|
- <Animated.View
|
134
|
|
- useNativeDriver
|
135
|
|
- style={{
|
136
|
|
- flexDirection: 'row',
|
137
|
|
- height: CustomTabBar.TAB_BAR_HEIGHT + this.props.safeArea.bottom,
|
138
|
|
- width: '100%',
|
139
|
|
- position: 'absolute',
|
140
|
|
- bottom: 0,
|
141
|
|
- left: 0,
|
142
|
|
- backgroundColor: this.props.theme.colors.surface,
|
143
|
|
- transform: [{translateY: this.state.translateY}],
|
144
|
|
- paddingBottom: this.props.safeArea.bottom,
|
145
|
|
- }}
|
146
|
|
- >
|
147
|
|
- {this.props.state.routes.map(this.renderIcon)}
|
148
|
|
- </Animated.View>
|
|
130
|
+ <Animated.View
|
|
131
|
+ useNativeDriver
|
|
132
|
+ style={{
|
|
133
|
+ flexDirection: 'row',
|
|
134
|
+ height: CustomTabBar.TAB_BAR_HEIGHT,
|
|
135
|
+ width: '100%',
|
|
136
|
+ position: 'absolute',
|
|
137
|
+ bottom: 0,
|
|
138
|
+ left: 0,
|
|
139
|
+ backgroundColor: this.props.theme.colors.surface,
|
|
140
|
+ transform: [{translateY: this.state.translateY}],
|
|
141
|
+ }}
|
|
142
|
+ >
|
|
143
|
+ {this.props.state.routes.map(this.renderIcon)}
|
|
144
|
+ </Animated.View>
|
149
|
145
|
);
|
150
|
146
|
}
|
151
|
147
|
}
|
152
|
148
|
|
153
|
|
-export default withSafeArea(withTheme(CustomTabBar));
|
|
149
|
+export default withTheme(CustomTabBar);
|