11import React , { StyleSheet , Text , View , Animated , Easing , PropTypes } from 'react-native' ;
22import NavButton from './NavButton' ;
3+ import * as Styles from '../styles' ;
34
45const propTypes = {
56 backButtonComponent : PropTypes . func ,
@@ -35,19 +36,20 @@ class NavBarContent extends React.Component {
3536 top : 0 ,
3637 left : 0 ,
3738 right : 0 ,
38- height : 64 , // Default iOS navbar height
39+ height : Styles . NAV_BAR_HEIGHT ,
3940 justifyContent : 'center' ,
4041 alignItems : 'center' ,
4142 flexDirection : 'row' ,
42- paddingTop : 13 ,
43+ paddingTop : Styles . NAV_BAR_PADDING_TOP ,
4344 } ,
4445 navbarText : {
4546 color : 'white' ,
4647 fontSize : 17 ,
4748 margin : 10 ,
48- marginTop : 14 ,
49+ marginTop : Styles . NAV_BAR_TEXT_MARGIN_TOP ,
50+ marginBottom : Styles . NAV_BAR_TEXT_MARGIN_TOP ,
4951 fontWeight : '600' ,
50- textAlign : 'center' ,
52+ textAlign : Styles . NAV_BAR_TEXT_ALIGN ,
5153 alignItems : 'center' ,
5254 } ,
5355 corner : {
@@ -141,11 +143,13 @@ class NavBarContent extends React.Component {
141143 ) ;
142144 }
143145
144- leftCorner = (
145- < View style = { [ this . styles . corner , this . styles . alignLeft ] } >
146- { leftCornerContent }
147- </ View >
148- ) ;
146+ if ( this . props . route . leftCorner || this . props . route . index > 0 ) {
147+ leftCorner = (
148+ < View style = { [ this . styles . corner , this . styles . alignLeft ] } >
149+ { leftCornerContent }
150+ </ View >
151+ ) ;
152+ }
149153
150154 /**
151155 * Set rightCorner
@@ -161,13 +165,13 @@ class NavBarContent extends React.Component {
161165 { ...this . props . route . rightCornerProps }
162166 />
163167 ) ;
164- }
165168
166- rightCorner = (
167- < View style = { [ this . styles . corner , this . styles . alignRight ] } >
168- { rightCornerContent }
169- </ View >
170- ) ;
169+ rightCorner = (
170+ < View style = { [ this . styles . corner , this . styles . alignRight ] } >
171+ { rightCornerContent }
172+ </ View >
173+ ) ;
174+ }
171175
172176 /**
173177 * Set title message
@@ -185,7 +189,7 @@ class NavBarContent extends React.Component {
185189 }
186190
187191 titleComponent = (
188- < View style = { { flex : 3 } } >
192+ < View style = { { flex : 6 } } >
189193 { titleContent }
190194 </ View >
191195 ) ;
0 commit comments