Extract labels and format date

This commit is contained in:
Julia Friesel
2018-06-05 17:44:31 +02:00
parent 090f4116d5
commit 8ee53ba75f
5 changed files with 17 additions and 9 deletions
+3 -1
View File
@@ -6,6 +6,7 @@ import {
} from 'react-native'
import styles from './styles'
import { formatDateForViewHeader } from './format'
import { bleeding as labels} from './labels'
export default class DayView extends Component {
constructor(props) {
@@ -18,10 +19,11 @@ export default class DayView extends Component {
render() {
const navigate = this.props.navigation.navigate
const day = this.state.cycleDay
const bleedingValue = day.bleeding && day.bleeding.value
return (
<View style={styles.container}>
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
<Text style={styles.welcome}>{day.bleeding && day.bleeding.value}</Text>
<Text style={styles.welcome}>{bleedingValue != undefined ? labels[bleedingValue] : ''}</Text>
<Button
onPress={() => navigate('bleeding', { cycleDay: day })}
title="Edit bleeding">