This repository was archived by the owner on Aug 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtop-bar.js
59 lines (54 loc) · 1.42 KB
/
top-bar.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
50
51
52
53
54
55
56
57
58
59
/* @flow */
import React from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet, Text, Platform, NativeModules } from 'react-native';
import Icon from 'react-native-vector-icons/SimpleLineIcons';
import * as colors from './utils/colors';
const statusBarHeight = Platform.OS === 'ios'
? 20
: NativeModules.StatusBarManager.HEIGHT;
const styles = StyleSheet.create({
container: {
backgroundColor: colors.darkBlue,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-start',
paddingLeft: 8,
paddingRight: 8,
paddingTop: statusBarHeight,
height: 60,
},
title: {
fontSize: 20,
color: colors.white,
},
});
const TopBar = props => (
<View>
<View style={styles.container}>
<Icon.Button
name="menu"
onPress={props.onMenuClick}
backgroundColor="transparent"
/>
{props.projectName
? <Text style={styles.title}>{props.projectName}</Text>
: <View style={{ flex: 1, flexDirection: 'row' }}>
<View
style={{
height: 20,
flex: 0.4,
backgroundColor: colors.lightWhite,
}}
/>
<View style={{ flex: 0.6 }} />
</View>}
</View>
</View>
);
TopBar.displayName = 'TopBar';
TopBar.propTypes = {
projectName: PropTypes.string,
onMenuClick: PropTypes.func.isRequired,
};
export default TopBar;