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} + + )}