forked from ptomasroos/react-native-tab-navigator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
TabBar.tsx
52 lines (46 loc) · 1.03 KB
/
TabBar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
'use strict';
import React from 'react';
import {
Animated,
Platform,
StyleSheet,
View,
ViewProps,
ViewStyle,
} from 'react-native';
import Layout from './Layout';
type ITabViewProps = ViewProps & {
shadowStyle?: ViewStyle,
style?: ViewStyle,
children?: React.ReactNode,
}
export default class TabBar extends React.Component<ITabViewProps> {
render() {
return (
<Animated.View {...this.props} style={[styles.container, this.props.style]}>
{this.props.children}
<View style={[styles.shadow, this.props.shadowStyle]} />
</Animated.View>
);
}
}
let styles = StyleSheet.create({
container: {
backgroundColor: '#f8f8f8',
flexDirection: 'row',
justifyContent: 'space-around',
height: Layout.tabBarHeight,
position: 'absolute',
bottom: 0,
left: 0,
right: 0,
},
shadow: {
backgroundColor: 'rgba(0, 0, 0, 0.25)',
height: Layout.pixel,
position: 'absolute',
left: 0,
right: 0,
top: Platform.OS === 'android' ? 0 : -Layout.pixel,
},
});