From 5d62cbfffe8100fb20f96e196192b03232c346c9 Mon Sep 17 00:00:00 2001 From: bl00dymarie Date: Fri, 5 Jan 2024 20:17:47 +0100 Subject: [PATCH] Makes periodPrediction text on Home adjustable --- components/Home.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/Home.js b/components/Home.js index 820dc22..783d8c4 100644 --- a/components/Home.js +++ b/components/Home.js @@ -14,6 +14,7 @@ import { determinePredictionText, formatWithOrdinalSuffix, } from './helpers/home' +import { periodPredictionObservable } from '../local-storage' import { Colors, Fonts, Sizes, Spacing } from '../styles' import { LocalDate } from '@js-joda/core' @@ -32,6 +33,7 @@ const Home = ({ navigate, setDate }) => { const cycleDayNumber = getCycleDayNumber(todayDateString) const { status, phase, statusText } = getFertilityStatusForDay(todayDateString) + const isPeriodPredictionEnabled = periodPredictionObservable.value const prediction = determinePredictionText(getPredictedMenses(), t) const cycleDayText = cycleDayNumber @@ -65,9 +67,11 @@ const Home = ({ navigate, setDate }) => { )} - - {prediction} - + {isPeriodPredictionEnabled && ( + + {prediction} + + )}