Replace getOrCreateCycleDay

This commit is contained in:
Julia Friesel
2018-11-16 14:24:16 +01:00
parent ecca6cfda9
commit bb0a535d65
18 changed files with 255 additions and 309 deletions
+7 -5
View File
@@ -14,11 +14,12 @@ import SymptomSection from './symptom-section'
export default class Bleeding extends Component {
constructor(props) {
super(props)
this.cycleDay = props.cycleDay
const cycleDay = props.cycleDay
this.bleeding = cycleDay && cycleDay.bleeding
this.makeActionButtons = props.makeActionButtons
this.state = {
currentValue: this.cycleDay.bleeding && this.cycleDay.bleeding.value,
exclude: this.cycleDay.bleeding ? this.cycleDay.bleeding.exclude : false
currentValue: this.bleeding && this.bleeding.value,
exclude: this.bleeding ? this.bleeding.exclude : false
}
}
@@ -57,9 +58,10 @@ export default class Bleeding extends Component {
</ScrollView>
<ActionButtonFooter
symptom='bleeding'
cycleDay={this.props.cycleDay}
date={this.props.date}
currentSymptomValue={this.bleeding}
saveAction={() => {
saveSymptom('bleeding', this.props.cycleDay, {
saveSymptom('bleeding', this.props.date, {
value: this.state.currentValue,
exclude: this.state.exclude
})