Add symptom view component with back button listener

This commit is contained in:
Julia Friesel
2019-05-11 17:42:57 +02:00
parent 2528c03315
commit 08fd3afc34
11 changed files with 113 additions and 72 deletions
+13 -3
View File
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import {
View,
Switch,
@@ -10,15 +10,25 @@ import { cervix as labels } from '../../../i18n/en/cycle-day'
import ActionButtonFooter from './action-button-footer'
import SelectTabGroup from '../select-tab-group'
import SymptomSection from './symptom-section'
import SymptomView from './symptom-view'
export default class Cervix extends Component {
export default class Cervix extends SymptomView {
constructor(props) {
super(props)
super()
const cycleDay = props.cycleDay
this.cervix = cycleDay && cycleDay.cervix
this.state = this.cervix ? this.cervix : {}
}
save() {
saveSymptom('cervix', this.props.date, {
opening: this.state.opening,
firmness: this.state.firmness,
position: this.state.position,
exclude: Boolean(this.state.exclude)
})
}
render() {
const cervixOpeningRadioProps = [
{ label: labels.opening.categories[0], value: 0 },