Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import React, { Component } from 'react'
import {
View,
Text,
TextInput,
} from 'react-native'
import styles from '../../../styles'
import { saveSymptom } from '../../../db'
export default class Temp extends Component {
constructor(props) {
super(props)
this.cycleDay = props.cycleDay
const note = this.cycleDay.note
this.makeActionButtons = props.makeActionButtons
this.state = {
currentValue: note && note.value || ''
}
}
render() {
return (
<View style={styles.symptomEditView}>
<View style={styles.symptomViewRow}>
<Text style={styles.symptomDayView}>Note</Text>
<TextInput
multiline={true}
placeholder="Enter"
onChangeText={(val) => {
this.setState({ currentValue: val })
}}
value={this.state.currentValue}
/>
</View>
<View style={styles.actionButtonRow}>
{this.makeActionButtons({
symptom: 'note',
cycleDay: this.cycleDay,
saveAction: () => {
saveSymptom('note', this.cycleDay, {
value: this.state.currentValue
})
},
saveDisabled: !this.state.currentValue
})}
</View>
</View>
)
}