forked from jineshshah36/react-native-nav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (43 loc) · 1.22 KB
/
index.js
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
/* @flow */
import React, { PropTypes } from 'react'
import { View, Platform,} from 'react-native';
import { StatusBarEnhanced } from './components/StatusBarEnhanced'
export { NavGroup } from './components/NavGroup'
export { NavButton } from './components/NavButton'
export { NavButtonText } from './components/NavButtonText'
export { NavTitle } from './components/NavTitle'
import styles from './styles'
function NavigationBar({ style, children, statusBar }: Object): React.Element {
let navBar = null
if (Platform.OS === 'ios') {
navBar = (
<View style={[styles.navBar, styles.navBarIOS, style.navBar]}>
{children}
</View>
)
} else if (Platform.OS === 'android') {
navBar = (
<View style={[styles.navBar, styles.navBarAndroid, style.navBar]}>
{children}
</View>
)
}
return (
<View style={[styles.navBarContainer, style.navBarContainer]}>
<StatusBarEnhanced style={style.statusBar}
statusBar={statusBar}
/>
{navBar}
</View>
)
}
NavigationBar.propTypes = {
statusBar: PropTypes.object,
style: PropTypes.object,
children: PropTypes.node,
}
NavigationBar.defaultProps = {
style: {},
statusBar: {},
}
export default NavigationBar