-
Notifications
You must be signed in to change notification settings - Fork 0
/
Navbar.js
executable file
·45 lines (41 loc) · 1.24 KB
/
Navbar.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
/**
* This is the navbar component
* example of usage:
* var left = (<Left><Button transparent><Icon name='menu' /></Button></Left>);
* var right = (<Right><Button transparent><Icon name='menu' /></Button></Right>);
* <Navbar left={left} right={right} title="My Navbar" />
**/
// React native and others libraries imports
import React, { Component } from 'react';
import { Header, Body, Title, Left, Right, Icon } from 'native-base';
// Our custom files and classes import
import Colors from '../Colors';
export default class Navbar extends Component {
render() {
return(
<Header
style={{backgroundColor: Colors.navbarBackgroundColor}}
backgroundColor={Colors.navbarBackgroundColor}
androidStatusBarColor={Colors.statusBarColor}
noShadow={true}
>
{this.props.left ? this.props.left : <Left style={{flex: 1}} />}
<Body style={styles.body}>
<Title style={styles.title}>{this.props.title}</Title>
</Body>
{this.props.right ? this.props.right : <Right style={{flex: 1}} />}
</Header>
);
}
}
const styles={
body: {
flex:1,
justifyContent: 'center',
alignItems: 'center'
},
title: {
fontFamily: 'Roboto',
fontWeight: '100'
}
};