Refactors the header

This commit is contained in:
Sofiya Tepikin
2019-09-14 12:39:30 +02:00
parent 20595c6c3a
commit 5d436630d3
15 changed files with 175 additions and 195 deletions
+10 -7
View File
@@ -109,16 +109,19 @@ class App extends Component {
const Page = pages[currentPage]
const title = headerTitlesLowerCase[currentPage]
const hasDefaultHeader =
!this.isSymptomView() &&
currentPage !== CYCLE_DAY_PAGE
const isSettingsSubView = this.isSettingsView()
return (
<View style={{flex: 1}}>
{this.isDefaultView() &&
<Header title={title} />
}
{(this.isSettingsView()) &&
<View style={{ flex: 1 }}>
{ hasDefaultHeader &&
<Header
handleBack={isSettingsSubView ? this.handleBackButtonPress : null}
title={title}
showBackButton={true}
goBack={this.handleBackButtonPress}
/>
}