Merge branch '52-add-edit-symptoms-for-today-button' into 'master'
Resolve "add edit symptoms for today button" Closes #52 See merge request bloodyhealth/drip!14
This commit is contained in:
@@ -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
|
||||
|
||||
Generated
+1566
-1561
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user