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
+9 -7
View File
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import {
View,
ScrollView,
@@ -11,8 +11,9 @@ import ActionButtonFooter from './action-button-footer'
import SymptomSection from './symptom-section'
import { noteExplainer } from '../../../i18n/en/cycle-day'
import { shared as sharedLabels } from '../../../i18n/en/labels'
import SymptomView from './symptom-view'
export default class Note extends Component {
export default class Note extends SymptomView {
constructor(props) {
super(props)
const cycleDay = props.cycleDay
@@ -23,6 +24,12 @@ export default class Note extends Component {
}
}
save() {
saveSymptom('note', this.props.date, {
value: this.state.currentValue
})
}
render() {
return (
<View style={{ flex: 1 }}>
@@ -45,11 +52,6 @@ export default class Note extends Component {
symptom='note'
date={this.props.date}
currentSymptomValue={this.note}
saveAction={() => {
saveSymptom('note', this.props.date, {
value: this.state.currentValue
})
}}
saveDisabled={!this.state.currentValue}
navigate={this.props.navigate}
/>