From 95afd305a9211cc9f04ebbe9e5f0c366e5e62834 Mon Sep 17 00:00:00 2001 From: emelko Date: Tue, 12 Mar 2019 22:50:24 +0100 Subject: [PATCH] Handing over cycleday to homescreen so that BleedingEditView gets this info; co-authored @liv-theo --- components/home.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/components/home.js b/components/home.js index 3aa51b2..f362285 100644 --- a/components/home.js +++ b/components/home.js @@ -1,19 +1,20 @@ +import { ChronoUnit, LocalDate } from 'js-joda' import React, { Component } from 'react' -import { ScrollView, View, TouchableHighlight, Dimensions } from 'react-native' -import { LocalDate, ChronoUnit } from 'js-joda' +import { Dimensions, ScrollView, TouchableHighlight, View } from 'react-native' import Icon from 'react-native-vector-icons/Entypo' -import { secondaryColor, cycleDayColor, periodColor } from '../styles' + +import DripHomeIcon from '../assets/drip-home-icons' +import { getCycleDay } from '../db' import { - home as labels, bleedingPrediction as predictLabels, + home as labels, shared, } from '../i18n/en/labels' import links from '../i18n/en/links' import cycleModule from '../lib/cycle' import { getFertilityStatusForDay } from '../lib/sympto-adapter' -import styles from '../styles' +import styles, { cycleDayColor, periodColor, secondaryColor } from '../styles' import AppText from './app-text' -import DripHomeIcon from '../assets/drip-home-icons' import Button from './button' const ShowMoreToggler = ({ isShowingMore, onToggle }) => { @@ -83,7 +84,10 @@ export default class Home extends Component { passTodayTo(componentName) { const { navigate } = this.props - navigate(componentName, { date: LocalDate.now().toString() }) + navigate(componentName, { + date: this.todayDateString, + cycleDay: getCycleDay(this.todayDateString) + }) } toggleShowingMore = () => {