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

This commit is contained in:
tina
2018-06-13 12:28:23 +02:00
parent 6d37d4517e
commit 30304bb1b5
3 changed files with 1577 additions and 1562 deletions
+10 -1
View File
@@ -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
+1566 -1561
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -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",