From 24675834e854c480e41fd6b2faa3ddb17bbf81a6 Mon Sep 17 00:00:00 2001 From: "guilhem.carron" <gcarron@grandlyon.com> Date: Thu, 2 Dec 2021 16:45:26 +0100 Subject: [PATCH] fix(analysis): Show no data if no enedis analysis --- src/components/Analysis/ElecHalfHourMonthlyAnalysis.tsx | 6 +++++- src/components/Analysis/elecHalfHourMonthlyAnalysis.scss | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Analysis/ElecHalfHourMonthlyAnalysis.tsx b/src/components/Analysis/ElecHalfHourMonthlyAnalysis.tsx index be9c2d3df..1320e16c0 100644 --- a/src/components/Analysis/ElecHalfHourMonthlyAnalysis.tsx +++ b/src/components/Analysis/ElecHalfHourMonthlyAnalysis.tsx @@ -123,13 +123,17 @@ const ElecHalfHourMonthlyAnalysis: React.FC<ElecHalfHourMonthlyAnalysisProps> = </div> {!isLoading ? ( <> - {monthDataloads && ( + {monthDataloads ? ( <ElecHalfHourChart dataLoad={ isWeekend ? monthDataloads.weekend : monthDataloads.week } isWeekend={isWeekend} /> + ) : ( + <p className={`text-20-bold no_data`}> + {t('analysis.no_data')} + </p> )} {enedisAnalysisValues && ( <div className="min-max"> diff --git a/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss b/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss index 30f836559..ec2f61057 100644 --- a/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss +++ b/src/components/Analysis/elecHalfHourMonthlyAnalysis.scss @@ -48,6 +48,10 @@ .loader-container { text-align: center; } + .no_data { + text-align: center; + color: white; + } } .graph-elec-half-hour { height: 13rem; -- GitLab