From 30304bb1b596f069e3a2b953bb9f8a81e044ddc7 Mon Sep 17 00:00:00 2001 From: tina Date: Wed, 13 Jun 2018 12:28:23 +0200 Subject: [PATCH] button 'edit symptoms for today' actually goes to dayview of today --- home.js | 11 +- package-lock.json | 3127 +++++++++++++++++++++++---------------------- package.json | 1 + 3 files changed, 1577 insertions(+), 1562 deletions(-) diff --git a/home.js b/home.js index 3552246..c32e26a 100644 --- a/home.js +++ b/home.js @@ -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 ( Welcome! Today is day {getCycleDay()} of your current cycle