Add edit bleeding and persist it.
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
import React, { Component } from 'react'
|
||||
import {
|
||||
View,
|
||||
Button,
|
||||
Text
|
||||
} from 'react-native'
|
||||
import styles from './styles'
|
||||
import { formatDateForViewHeader } from './format'
|
||||
|
||||
export default class DayView extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
cycleDay: props.navigation.state.params.cycleDay
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const navigate = this.props.navigation.navigate
|
||||
const day = this.state.cycleDay
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Text style={styles.welcome}>{formatDateForViewHeader(day.date)}</Text>
|
||||
<Text style={styles.welcome}>{day.bleeding && day.bleeding.value}</Text>
|
||||
<Button
|
||||
onPress={() => navigate('bleeding', { cycleDay: day })}
|
||||
title="Edit bleeding">
|
||||
</Button>
|
||||
</View >
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user