Add explainers to sex view

This commit is contained in:
Julia Friesel
2018-09-01 22:46:02 +02:00
parent 51622867a2
commit 6baeaa0393
2 changed files with 34 additions and 24 deletions
+3 -1
View File
@@ -43,7 +43,9 @@ export const sex = {
patch: 'Patch', patch: 'Patch',
ring: 'Ring', ring: 'Ring',
implant: 'Implant', implant: 'Implant',
other: 'Other' other: 'Other',
activityExplainer: 'Were you sexually active today?',
contraceptiveExplainer: 'Did you use contraceptives?'
} }
export const pain = { export const pain = {
+21 -13
View File
@@ -6,39 +6,39 @@ import {
} from 'react-native' } from 'react-native'
import styles from '../../../styles' import styles from '../../../styles'
import { saveSymptom } from '../../../db' import { saveSymptom } from '../../../db'
import { sex as sexLabels } from '../labels/labels' import { sex as labels } from '../labels/labels'
import ActionButtonFooter from './action-button-footer' import ActionButtonFooter from './action-button-footer'
import SelectBoxGroup from '../select-box-group' import SelectBoxGroup from '../select-box-group'
import { SymptomSectionHeader } from '../../app-text' import SymptomSection from './symptom-section'
const sexBoxes = [{ const sexBoxes = [{
label: sexLabels.solo, label: labels.solo,
stateKey: 'solo' stateKey: 'solo'
}, { }, {
label: sexLabels.partner, label: labels.partner,
stateKey: 'partner' stateKey: 'partner'
}] }]
const contraceptiveBoxes = [{ const contraceptiveBoxes = [{
label: sexLabels.condom, label: labels.condom,
stateKey: 'condom' stateKey: 'condom'
}, { }, {
label: sexLabels.pill, label: labels.pill,
stateKey: 'pill' stateKey: 'pill'
}, { }, {
label: sexLabels.iud, label: labels.iud,
stateKey: 'iud' stateKey: 'iud'
}, { }, {
label: sexLabels.patch, label: labels.patch,
stateKey: 'patch' stateKey: 'patch'
}, { }, {
label: sexLabels.ring, label: labels.ring,
stateKey: 'ring' stateKey: 'ring'
}, { }, {
label: sexLabels.implant, label: labels.implant,
stateKey: 'implant' stateKey: 'implant'
}, { }, {
label: sexLabels.other, label: labels.other,
stateKey: 'other' stateKey: 'other'
}] }]
@@ -69,18 +69,26 @@ export default class Sex extends Component {
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<SymptomSectionHeader>Activity</SymptomSectionHeader> <SymptomSection
header="Activity"
explainer={labels.activityExplainer}
>
<SelectBoxGroup <SelectBoxGroup
data={sexBoxes} data={sexBoxes}
onSelect={this.toggleState} onSelect={this.toggleState}
optionsState={this.state} optionsState={this.state}
/> />
<SymptomSectionHeader>Contraceptives</SymptomSectionHeader> </SymptomSection>
<SymptomSection
header="Contraceptives"
explainer={labels.contraceptiveExplainer}
>
<SelectBoxGroup <SelectBoxGroup
data={contraceptiveBoxes} data={contraceptiveBoxes}
onSelect={this.toggleState} onSelect={this.toggleState}
optionsState={this.state} optionsState={this.state}
/> />
</SymptomSection>
{this.state.other && {this.state.other &&
<TextInput <TextInput