From 0962711b92ad9e28cd2f951f0644f098154c648e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Prod=27homme?= Date: Thu, 24 Oct 2024 16:55:26 +0200 Subject: [PATCH] feat(conservation-builder): Add text on chart SKY30-504 --- .../stacked-horizontal-bar-chart/index.tsx | 23 +++++++++++++------ .../panels/modelling/widget/index.tsx | 2 ++ frontend/translations/en.json | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/charts/stacked-horizontal-bar-chart/index.tsx b/frontend/src/components/charts/stacked-horizontal-bar-chart/index.tsx index cc741fae..c969fbe6 100644 --- a/frontend/src/components/charts/stacked-horizontal-bar-chart/index.tsx +++ b/frontend/src/components/charts/stacked-horizontal-bar-chart/index.tsx @@ -11,6 +11,7 @@ type StackedHorizontalBarChartProps = { className: string; title?: string; info?: string; + customArea: number; totalProtectedArea: number; totalArea: number; highlightedPercentage: number; @@ -28,6 +29,7 @@ const StackedHorizontalBarChart: FCWithMessages data, title, info, + customArea, totalProtectedArea, totalArea, highlightedPercentage, @@ -43,17 +45,24 @@ const StackedHorizontalBarChart: FCWithMessages {formatPercentage(locale, highlightedPercentage, { displayPercentageSign: false })} % -
+
{title && title} {info && } - - {t('marine-protected-area', { - protectedArea: formatKM(locale, totalProtectedArea), - totalArea: formatKM(locale, totalArea), - })} - +
+
+ {t('marine-protected-area', { + protectedArea: formatKM(locale, totalProtectedArea), + totalArea: formatKM(locale, totalArea), + })} +
+
+ {t('new-added-area', { + area: formatKM(locale, customArea), + })} +
+
diff --git a/frontend/src/containers/map/sidebar/main-panel/panels/modelling/widget/index.tsx b/frontend/src/containers/map/sidebar/main-panel/panels/modelling/widget/index.tsx index 008772d6..f64f7325 100644 --- a/frontend/src/containers/map/sidebar/main-panel/panels/modelling/widget/index.tsx +++ b/frontend/src/containers/map/sidebar/main-panel/panels/modelling/widget/index.tsx @@ -335,6 +335,7 @@ const ModellingWidget: FCWithMessages = () => { {