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 { ...@@ -4,21 +4,30 @@ import {
Button, Button,
Text Text
} from 'react-native' } from 'react-native'
import { LocalDate } from 'js-joda'
import styles from './styles' import styles from './styles'
import getCycleDay from './get-cycle-day' import getCycleDay from './get-cycle-day'
import { getOrCreateCycleDay } from './db'
export default class Home extends Component { export default class Home extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
passTodayToDayView() {
const todayDateString = LocalDate.now().toString()
const cycleDay = getOrCreateCycleDay(todayDateString)
const navigate = this.props.navigation.navigate
navigate('dayView', { cycleDay })
}
render() { render() {
const navigate = this.props.navigation.navigate const navigate = this.props.navigation.navigate
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={styles.welcome}>Welcome! Today is day {getCycleDay()} of your current cycle</Text> <Text style={styles.welcome}>Welcome! Today is day {getCycleDay()} of your current cycle</Text>
<Button <Button
onPress={() => navigate('temperatureList')} onPress={() => this.passTodayToDayView()}
title="Edit symptoms for today"> title="Edit symptoms for today">
</Button> </Button>
<Button <Button
......
This diff is collapsed.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"lint": "eslint app test" "lint": "eslint app test"
}, },
"dependencies": { "dependencies": {
"js-joda": "^1.8.2",
"moment": "^2.22.1", "moment": "^2.22.1",
"react": "16.3.1", "react": "16.3.1",
"react-native": "0.55.4", "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