adds note to temperature

This commit is contained in:
tina
2018-08-31 14:01:48 +02:00
parent 54a3db4096
commit 3bd5770c33
3 changed files with 24 additions and 3 deletions
+18 -2
View File
@@ -33,7 +33,8 @@ export default class Temp extends Component {
exclude: temp ? temp.exclude : false, exclude: temp ? temp.exclude : false,
time: temp ? temp.time : LocalTime.now().truncatedTo(minutes).toString(), time: temp ? temp.time : LocalTime.now().truncatedTo(minutes).toString(),
isTimePickerVisible: false, isTimePickerVisible: false,
outOfRange: null outOfRange: null,
note: temp ? temp.note : null
} }
if (temp) { if (temp) {
@@ -54,7 +55,8 @@ export default class Temp extends Component {
const dataToSave = { const dataToSave = {
value: Number(this.state.temperature), value: Number(this.state.temperature),
exclude: this.state.exclude, exclude: this.state.exclude,
time: this.state.time time: this.state.time,
note: this.state.note
} }
saveSymptom('temperature', this.cycleDay, dataToSave) saveSymptom('temperature', this.cycleDay, dataToSave)
this.props.navigate('CycleDay', {cycleDay: this.cycleDay}) this.props.navigate('CycleDay', {cycleDay: this.cycleDay})
@@ -126,6 +128,20 @@ export default class Temp extends Component {
}} }}
onCancel={() => this.setState({ isTimePickerVisible: false })} onCancel={() => this.setState({ isTimePickerVisible: false })}
/> />
<View style={styles.symptomViewRowInline}>
<Text style={styles.symptomDayView}>Note (anomaly)</Text>
<TextInput
style={styles.temperatureTextInput}
multiline={false}
maxLength={30}
autoFocus={this.state.focusTextArea}
placeholder="-"
value={this.state.note}
onChangeText={(val) => {
this.setState({ note: val })
}}
/>
</View>
<View style={styles.symptomViewRowInline}> <View style={styles.symptomViewRowInline}>
<Text style={styles.symptomDayView}>Exclude</Text> <Text style={styles.symptomDayView}>Exclude</Text>
<Switch <Switch
+4
View File
@@ -15,6 +15,10 @@ const TemperatureSchema = {
type: 'string', type: 'string',
optional: true optional: true
}, },
note: {
type: 'string',
optional: true
}
} }
} }
+2 -1
View File
@@ -132,7 +132,8 @@ export default StyleSheet.create({
}, },
temperatureTextInput: { temperatureTextInput: {
fontSize: 20, fontSize: 20,
color: 'black' color: 'black',
textAlign: 'right'
}, },
temperatureTextInputSuggestion: { temperatureTextInputSuggestion: {
color: '#939393' color: '#939393'