Extract labels and format date
This commit is contained in:
+3
-1
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user