Adding "other" as pain option and link text input to it
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -171,7 +171,7 @@ function getLabel(symptomName, symptom) {
|
||||
let painLabel = ''
|
||||
if (pain.cramps || pain.ovulationPain || pain.headache ||
|
||||
pain.backache || pain.nausea || pain.tenderBreasts ||
|
||||
pain.migraine
|
||||
pain.migraine || pain.other
|
||||
) {
|
||||
painLabel += 'Pain'
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ export const pain = {
|
||||
backache: 'Backache',
|
||||
nausea: 'Nausea',
|
||||
tenderBreasts: 'Tender breasts',
|
||||
migraine: 'Migraine'
|
||||
migraine: 'Migraine',
|
||||
other: 'Other'
|
||||
}
|
||||
|
||||
export const fertilityStatus = {
|
||||
|
||||
@@ -2,6 +2,7 @@ import React, { Component } from 'react'
|
||||
import {
|
||||
CheckBox,
|
||||
Text,
|
||||
TextInput,
|
||||
View
|
||||
} from 'react-native'
|
||||
import styles from '../../../styles'
|
||||
@@ -91,6 +92,31 @@ export default class Pain extends Component {
|
||||
this.setState({migraine: val})
|
||||
}}
|
||||
/>
|
||||
<Text style={styles.symptomDayView}>
|
||||
{painLabels.other}
|
||||
</Text>
|
||||
<CheckBox
|
||||
value={this.state.other}
|
||||
onValueChange={(val) => {
|
||||
this.setState({
|
||||
other: val,
|
||||
focusTextArea: true
|
||||
})
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.symptomViewRowInline}>
|
||||
{ this.state.other &&
|
||||
<TextInput
|
||||
autoFocus={this.state.focusTextArea}
|
||||
multiline={true}
|
||||
placeholder="Enter"
|
||||
value={this.state.note}
|
||||
onChangeText={(val) => {
|
||||
this.setState({note: val})
|
||||
}}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
<View style={styles.actionButtonRow}>
|
||||
{this.props.makeActionButtons(
|
||||
|
||||
+3
-1
@@ -84,7 +84,9 @@ const PainSchema = {
|
||||
headache: { type: 'bool', optional: true },
|
||||
backache: { type: 'bool', optional: true },
|
||||
nausea: { type: 'bool', optional: true },
|
||||
tenderBreasts: { type: 'bool', optional: true }
|
||||
tenderBreasts: { type: 'bool', optional: true },
|
||||
other: { type: 'bool', optional: true },
|
||||
note: { type: 'string', optional: true }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user