From d0dcbd543d35c638aa5f84a66330131cd9379fcb Mon Sep 17 00:00:00 2001 From: emelko Date: Mon, 4 Feb 2019 21:04:17 +0100 Subject: [PATCH] Adds back button to settings header --- components/app.js | 17 +++++++++-------- components/header/index.js | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/components/app.js b/components/app.js index fc8f7e3..da47365 100644 --- a/components/app.js +++ b/components/app.js @@ -94,9 +94,7 @@ export default class App extends Component { isDefaultView() { const { currentPage } = this.state - return currentPage !== CYCLE_DAY_PAGE && - !this.isSymptomView() && - !this.isInfoSymptomView() + return this.isMenuItem(currentPage) || currentPage === SETTINGS_MENU_PAGE } render() { @@ -114,16 +112,19 @@ export default class App extends Component { } const page = pages[currentPage] const title = headerTitlesLowerCase[currentPage] - const isSymptomView = this.isSymptomView() return ( {this.isDefaultView() &&
} - {this.isInfoSymptomView() && -
+ {(this.isInfoSymptomView() || this.isSettingsView()) && +
} - {isSymptomView && + {this.isSymptomView() &&
} diff --git a/components/header/index.js b/components/header/index.js index 5ee9009..9792d03 100644 --- a/components/header/index.js +++ b/components/header/index.js @@ -15,7 +15,7 @@ export default function Header(p) { else if (props.isSymptomView) { return () } - else if (props.title === 'info') { + else if (props.showBackButton) { return () } else {