Add label in front of bleeding value

This commit is contained in:
Julia Friesel
2018-06-05 18:36:03 +02:00
parent a8c981ee3e
commit a5265cb9a1
+8 -1
View File
@@ -20,10 +20,17 @@ export default class DayView extends Component {
const navigate = this.props.navigation.navigate
const day = this.state.cycleDay
const bleedingValue = day.bleeding && day.bleeding.value
let bleedingLabel
if (typeof bleedingValue === 'number') {
bleedingLabel = `Bleeding: ${labels[bleedingValue]}`
} else {
bleedingLabel = ''
}
return (
<View style={styles.container}>
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
<Text style={styles.welcome}>{typeof bleedingValue === 'number' ? labels[bleedingValue] : ''}</Text>
<Text style={styles.welcome}>{bleedingLabel}</Text>
<Button
onPress={() => navigate('bleeding', { cycleDay: day })}
title="Edit bleeding">