button 'edit symptoms for today' actually goes to dayview of today
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Generated
+1566
-1561
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user