Merge branch 'master' into '28-edit-temperature-screen'
# Conflicts: # home.js
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
image: jfr3000/docker-nativescript
|
image: node:8
|
||||||
|
|
||||||
# This folder is cached between builds
|
# This folder is cached between builds
|
||||||
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
|
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
|
||||||
|
|||||||
@@ -4,19 +4,32 @@ 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
|
||||||
|
onPress={() => this.passTodayToDayView()}
|
||||||
|
title="Edit symptoms for today">
|
||||||
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onPress={() => navigate('calendar')}
|
onPress={() => navigate('calendar')}
|
||||||
title="Go to calendar">
|
title="Go to calendar">
|
||||||
|
|||||||
Generated
+1561
-1561
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user