[WIP] first draft implementing mucus

This commit is contained in:
emelko
2018-07-04 13:03:23 +02:00
parent 7dee497431
commit 2b5e6351f7
5 changed files with 159 additions and 9 deletions
+26 -3
View File
@@ -5,7 +5,10 @@ import {
Text
} from 'react-native'
import styles from '../../styles'
import { bleeding as labels} from './labels/labels'
import {
bleedingLabels as bleedingLabels,
mucusFeeling as feelingLabels
} from './labels/labels'
import cycleDayModule from '../../lib/get-cycle-day-number'
import { bleedingDaysSortedByDate } from '../../db'
@@ -39,7 +42,7 @@ export default class DayView extends Component {
const bleedingValue = this.cycleDay.bleeding && this.cycleDay.bleeding.value
let bleedingLabel
if (typeof bleedingValue === 'number') {
bleedingLabel = `${labels[bleedingValue]}`
bleedingLabel = `${bleedingLabels[bleedingValue]}`
if (this.cycleDay.bleeding.exclude) bleedingLabel = "( " + bleedingLabel + " )"
} else {
bleedingLabel = 'edit'
@@ -55,6 +58,15 @@ export default class DayView extends Component {
temperatureLabel = 'edit'
}
const mucusFeelingValue = this.cycleDay.mucus && this.cycleDay.mucus.value
let mucusFeelingLabel
if (typeof mucusFeelingValue === 'number') {
mucusFeelingLabel = `${feelingLabels[mucusFeelingValue]}`
if (this.cycleDay.mucus.exclude) mucusFeelingLabel = "( " + mucusFeelingLabel + " )"
} else {
mucusFeelingLabel = 'edit'
}
return (
<View style={styles.symptomEditView}>
<View style={styles.symptomViewRowInline}>
@@ -75,7 +87,18 @@ export default class DayView extends Component {
</Button>
</View>
</View>
<View style={ styles.itemsInRowSeparatedView }>
<View style={{flex: 1}}>
<Text style={styles.symptomDayView}>Mucus</Text>
</View>
<View style={ styles.singleButtonView }>
<Button
onPress={() => this.showView('mucusEditView')}
title={mucusFeelingLabel}>
</Button>
</View>
</View>
</View >
)
}
}
}