Add explainers to mucus

This commit is contained in:
Julia Friesel
2018-09-01 22:01:05 +02:00
parent 98fbacf9f8
commit cffa42ed1c
2 changed files with 43 additions and 27 deletions
+12 -2
View File
@@ -1,6 +1,4 @@
export const bleeding = ['spotting', 'light', 'medium', 'heavy'] export const bleeding = ['spotting', 'light', 'medium', 'heavy']
export const mucusFeeling = ['dry', 'nothing', 'wet', 'slippery']
export const mucusTexture = ['nothing', 'creamy', 'egg white']
export const mucusNFP = ['t', 'Ø', 'f', 'S', 'S+'] export const mucusNFP = ['t', 'Ø', 'f', 'S', 'S+']
export const intensity = ['low', 'medium', 'high'] export const intensity = ['low', 'medium', 'high']
@@ -19,6 +17,18 @@ export const cervix = {
} }
} }
export const mucus = {
feeling: {
categories: ['dry', 'nothing', 'wet', 'slippery'],
explainer: 'What does your vaginal entrance feel like?'
},
texture: {
categories: ['nothing', 'creamy', 'egg white'],
explainer: "Looking at and touching your cervical mucus, which describes it best?"
},
excludeExplainer: "You can exclude this value if you don't want to use it for fertility detection"
}
export const desire = { export const desire = {
header: 'Intensity', header: 'Intensity',
explainer: 'How would you rate your sexual desire?' explainer: 'How would you rate your sexual desire?'
+31 -25
View File
@@ -6,14 +6,11 @@ import {
} from 'react-native' } from 'react-native'
import styles from '../../../styles' import styles from '../../../styles'
import { saveSymptom } from '../../../db' import { saveSymptom } from '../../../db'
import { import { mucus as labels } from '../labels/labels'
mucusFeeling as feelingLabels,
mucusTexture as textureLabels
} from '../labels/labels'
import computeSensiplanValue from '../../../lib/sensiplan-mucus' import computeSensiplanValue from '../../../lib/sensiplan-mucus'
import ActionButtonFooter from './action-button-footer' import ActionButtonFooter from './action-button-footer'
import SelectTabGroup from '../select-tab-group' import SelectTabGroup from '../select-tab-group'
import { SymptomSectionHeader } from '../../app-text' import SymptomSection from './symptom-section';
export default class Mucus extends Component { export default class Mucus extends Component {
@@ -37,42 +34,51 @@ export default class Mucus extends Component {
render() { render() {
const mucusFeeling = [ const mucusFeeling = [
{ label: feelingLabels[0], stateKey: ''}, { label: labels.feeling.categories[0], stateKey: ''},
{ label: feelingLabels[1], value: 1 }, { label: labels.feeling.categories[1], value: 1 },
{ label: feelingLabels[2], value: 2 }, { label: labels.feeling.categories[2], value: 2 },
{ label: feelingLabels[3], value: 3 } { label: labels.feeling.categories[3], value: 3 }
] ]
const mucusTexture = [ const mucusTexture = [
{ label: textureLabels[0], value: 0 }, { label: labels.texture.categories[0], value: 0 },
{ label: textureLabels[1], value: 1 }, { label: labels.texture.categories[1], value: 1 },
{ label: textureLabels[2], value: 2 } { label: labels.texture.categories[2], value: 2 }
] ]
return ( return (
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<ScrollView style={styles.page}> <ScrollView style={styles.page}>
<View> <SymptomSection
<SymptomSectionHeader>Feeling</SymptomSectionHeader> header='Feeling'
explainer={labels.feeling.explainer}
>
<SelectTabGroup <SelectTabGroup
buttons={mucusFeeling} buttons={mucusFeeling}
onSelect={val => this.setState({ feeling: val })} onSelect={val => this.setState({ feeling: val })}
active={this.state.feeling} active={this.state.feeling}
/> />
<SymptomSectionHeader>Texture</SymptomSectionHeader> </SymptomSection>
<SymptomSection
header='Texture'
explainer={labels.texture.explainer}
>
<SelectTabGroup <SelectTabGroup
buttons={mucusTexture} buttons={mucusTexture}
onSelect={val => this.setState({ texture: val })} onSelect={val => this.setState({ texture: val })}
active={this.state.texture} active={this.state.texture}
/> />
<View style={styles.symptomViewRowInline}> </SymptomSection>
<SymptomSectionHeader>Exclude</SymptomSectionHeader> <SymptomSection
<Switch header="Exclude"
onValueChange={(val) => { explainer={labels.excludeExplainer}
this.setState({ exclude: val }) inlineExplainer={true}
}} >
value={this.state.exclude} <Switch
/> onValueChange={(val) => {
</View> this.setState({ exclude: val })
</View> }}
value={this.state.exclude}
/>
</SymptomSection>
</ScrollView> </ScrollView>
<ActionButtonFooter <ActionButtonFooter
symptom='mucus' symptom='mucus'