Gets rid of old info symptom screen
This commit is contained in:
+2
-13
@@ -11,7 +11,6 @@ import SettingsMenu from './settings/settings-menu'
|
|||||||
import settingsViews from './settings'
|
import settingsViews from './settings'
|
||||||
import Stats from './stats'
|
import Stats from './stats'
|
||||||
import {headerTitles, menuTitles} from '../i18n/en/labels'
|
import {headerTitles, menuTitles} from '../i18n/en/labels'
|
||||||
import InfoSymptom from './cycle-day/symptoms/info-symptom'
|
|
||||||
import setupNotifications from '../lib/notifications'
|
import setupNotifications from '../lib/notifications'
|
||||||
|
|
||||||
// design wants everyhting lowercased, but we don't
|
// design wants everyhting lowercased, but we don't
|
||||||
@@ -22,7 +21,6 @@ const headerTitlesLowerCase = Object.keys(headerTitles).reduce((acc, curr) => {
|
|||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
const HOME_PAGE = 'Home'
|
const HOME_PAGE = 'Home'
|
||||||
const INFO_SYMPTOM_PAGE = 'InfoSymptom'
|
|
||||||
const CYCLE_DAY_PAGE = 'CycleDay'
|
const CYCLE_DAY_PAGE = 'CycleDay'
|
||||||
const SETTINGS_MENU_PAGE = 'SettingsMenu'
|
const SETTINGS_MENU_PAGE = 'SettingsMenu'
|
||||||
|
|
||||||
@@ -49,7 +47,7 @@ export default class App extends Component {
|
|||||||
if (this.isMenuItem()) {
|
if (this.isMenuItem()) {
|
||||||
this.menuOrigin = currentPage
|
this.menuOrigin = currentPage
|
||||||
}
|
}
|
||||||
if (!this.isSymptomView() && !this.isInfoSymptomView()) {
|
if (!this.isSymptomView()) {
|
||||||
this.originForSymptomView = currentPage
|
this.originForSymptomView = currentPage
|
||||||
}
|
}
|
||||||
this.setState({ currentPage: pageName, currentProps: props })
|
this.setState({ currentPage: pageName, currentProps: props })
|
||||||
@@ -66,10 +64,6 @@ export default class App extends Component {
|
|||||||
this.navigate(SETTINGS_MENU_PAGE)
|
this.navigate(SETTINGS_MENU_PAGE)
|
||||||
} else if (currentPage === CYCLE_DAY_PAGE) {
|
} else if (currentPage === CYCLE_DAY_PAGE) {
|
||||||
this.navigate(this.menuOrigin)
|
this.navigate(this.menuOrigin)
|
||||||
} else if (this.isInfoSymptomView()) {
|
|
||||||
const { date, cycleDay, symptomView } = currentProps
|
|
||||||
this.navigate(
|
|
||||||
symptomView, { date, cycleDay })
|
|
||||||
} else {
|
} else {
|
||||||
this.navigate(HOME_PAGE)
|
this.navigate(HOME_PAGE)
|
||||||
}
|
}
|
||||||
@@ -84,10 +78,6 @@ export default class App extends Component {
|
|||||||
return Object.keys(symptomViews).includes(this.state.currentPage)
|
return Object.keys(symptomViews).includes(this.state.currentPage)
|
||||||
}
|
}
|
||||||
|
|
||||||
isInfoSymptomView() {
|
|
||||||
return this.state.currentPage === INFO_SYMPTOM_PAGE
|
|
||||||
}
|
|
||||||
|
|
||||||
isSettingsView() {
|
isSettingsView() {
|
||||||
return Object.keys(settingsViews).includes(this.state.currentPage)
|
return Object.keys(settingsViews).includes(this.state.currentPage)
|
||||||
}
|
}
|
||||||
@@ -104,7 +94,6 @@ export default class App extends Component {
|
|||||||
Calendar,
|
Calendar,
|
||||||
CycleDay,
|
CycleDay,
|
||||||
Chart,
|
Chart,
|
||||||
InfoSymptom,
|
|
||||||
SettingsMenu,
|
SettingsMenu,
|
||||||
...settingsViews,
|
...settingsViews,
|
||||||
Stats,
|
Stats,
|
||||||
@@ -118,7 +107,7 @@ export default class App extends Component {
|
|||||||
{this.isDefaultView() &&
|
{this.isDefaultView() &&
|
||||||
<Header title={title} />
|
<Header title={title} />
|
||||||
}
|
}
|
||||||
{(this.isInfoSymptomView() || this.isSettingsView()) &&
|
{(this.isSettingsView()) &&
|
||||||
<Header
|
<Header
|
||||||
title={title}
|
title={title}
|
||||||
showBackButton={true}
|
showBackButton={true}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
import React, { Component } from 'react'
|
|
||||||
import { ScrollView } from 'react-native'
|
|
||||||
import AppText from '../../app-text'
|
|
||||||
import labels from '../../../i18n/en/symptom-info.js'
|
|
||||||
import FramedSegment from '../../framed-segment'
|
|
||||||
import styles from '../../../styles/index'
|
|
||||||
|
|
||||||
export default class InfoSymptom extends Component {
|
|
||||||
render() {
|
|
||||||
const symptomView = this.props.symptomView
|
|
||||||
const symptomMapping = {
|
|
||||||
BleedingEditView: 'bleeding',
|
|
||||||
CervixEditView: 'cervix',
|
|
||||||
DesireEditView: 'desire',
|
|
||||||
MoodEditView: 'mood',
|
|
||||||
MucusEditView: 'mucus',
|
|
||||||
NoteEditView: 'note',
|
|
||||||
PainEditView: 'pain',
|
|
||||||
SexEditView: 'sex',
|
|
||||||
TemperatureEditView: 'temperature'
|
|
||||||
}
|
|
||||||
const currentSymptom = symptomMapping[symptomView]
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ScrollView>
|
|
||||||
<FramedSegment
|
|
||||||
style={styles.framedSegmentLast}
|
|
||||||
title={labels[currentSymptom].title}
|
|
||||||
>
|
|
||||||
<AppText>{labels[currentSymptom].text}</AppText>
|
|
||||||
</FramedSegment>
|
|
||||||
</ScrollView>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user