Skip to content
Snippets Groups Projects
Commit 30304bb1 authored by tina's avatar tina
Browse files

button 'edit symptoms for today' actually goes to dayview of today

parent 6d37d451
No related branches found
No related tags found
No related merge requests found
......@@ -4,21 +4,30 @@ import {
Button,
Text
} from 'react-native'
import { LocalDate } from 'js-joda'
import styles from './styles'
import getCycleDay from './get-cycle-day'
import { getOrCreateCycleDay } from './db'
export default class Home extends Component {
constructor(props) {
super(props)
}
passTodayToDayView() {
const todayDateString = LocalDate.now().toString()
const cycleDay = getOrCreateCycleDay(todayDateString)
const navigate = this.props.navigation.navigate
navigate('dayView', { cycleDay })
}
render() {
const navigate = this.props.navigation.navigate
return (
<View style={styles.container}>
<Text style={styles.welcome}>Welcome! Today is day {getCycleDay()} of your current cycle</Text>
<Button
onPress={() => navigate('temperatureList')}
onPress={() => this.passTodayToDayView()}
title="Edit symptoms for today">
</Button>
<Button
......
This diff is collapsed.
......@@ -14,6 +14,7 @@
"lint": "eslint app test"
},
"dependencies": {
"js-joda": "^1.8.2",
"moment": "^2.22.1",
"react": "16.3.1",
"react-native": "0.55.4",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment