diff --git a/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/CustomLegend.tsx b/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/CustomLegend.tsx index 11035edbe..7c89bcf0f 100644 --- a/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/CustomLegend.tsx +++ b/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/CustomLegend.tsx @@ -1,6 +1,7 @@ import React from "react"; -import { Flex, Text, Badge } from "@chakra-ui/react"; +import { Flex, Text, Badge, Box } from "@chakra-ui/react"; import { getColorForSeries } from "./EmissionsForecastChart"; +import { ColoredCircle } from "@/components/ColoredCircle"; interface CustomLegendProps { data: { id: string; color: string }[]; @@ -12,7 +13,7 @@ const CustomLegend: React.FC = ({ data, t }) => { {data.map((series) => ( - + {t(series.id)} ))} diff --git a/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/EmissionsForecastChart.tsx b/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/EmissionsForecastChart.tsx index 93214bf73..71b59a85f 100644 --- a/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/EmissionsForecastChart.tsx +++ b/app/src/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/EmissionsForecastChart.tsx @@ -8,10 +8,13 @@ import { getSubSectorByReferenceNumber, ISector, } from "@/util/constants"; -import { Badge, Box, Card, Heading, Table, Text } from "@chakra-ui/react"; +import { Box, Card, Heading, HStack, Table, Text } from "@chakra-ui/react"; import { convertKgToTonnes, toKebabCase } from "@/util/helpers"; import { ResponsiveLine } from "@nivo/line"; import CustomLegend from "@/app/[lng]/[inventory]/InventoryResultTab/EmissionsForecast/CustomLegend"; +import { ColoredCircle } from "@/components/ColoredCircle"; +import { ButtonSmall } from "@/components/Texts/Button"; +import { TitleMedium } from "@/components/Texts/Title"; interface LineChartData { id: string; @@ -112,14 +115,22 @@ export const EmissionsForecastChart = ({ - + - {t("sector")} - {t("rate")} - % - {t("total-emissions")} + {t("sector").toUpperCase()} + + + {t("rate").toUpperCase()} + + + % + + + + {t("total-emissions").toUpperCase()} + @@ -146,12 +157,13 @@ export const EmissionsForecastChart = ({ return ( - - {t(id)} + + + {t(id)} + {growthRate} {percentage}% @@ -164,10 +176,14 @@ export const EmissionsForecastChart = ({ ); })} - {t("total")} + + {t("total").toUpperCase()} + - {convertKgToTonnes(sumOfYs)} + + {convertKgToTonnes(sumOfYs)} + diff --git a/app/src/app/[lng]/[inventory]/InventoryResultTab/TopEmissionsWidget.tsx b/app/src/app/[lng]/[inventory]/InventoryResultTab/TopEmissionsWidget.tsx index ec6bec926..76df74cf4 100644 --- a/app/src/app/[lng]/[inventory]/InventoryResultTab/TopEmissionsWidget.tsx +++ b/app/src/app/[lng]/[inventory]/InventoryResultTab/TopEmissionsWidget.tsx @@ -30,6 +30,7 @@ import { ProgressCircleRing, ProgressCircleRoot, } from "@/components/ui/progress-circle"; +import { ButtonSmall } from "@/components/Texts/Button"; const EmissionsTable = ({ topEmissions, @@ -39,20 +40,19 @@ const EmissionsTable = ({ t: TFunction; }) => { return ( - + - - {t("subsector")} + + {t("subsector").toUpperCase()} - - {t("total-emissions-CO2eq")} + + + {t("total-emissions-CO2eq").toUpperCase()} + - - {t("%-of-emissions")} + + {t("%-of-emissions").toUpperCase()} diff --git a/app/src/components/ColoredCircle/index.tsx b/app/src/components/ColoredCircle/index.tsx new file mode 100644 index 000000000..ebc4af243 --- /dev/null +++ b/app/src/components/ColoredCircle/index.tsx @@ -0,0 +1,22 @@ +import { Box, BoxProps } from "@chakra-ui/react"; + +interface ColoredCircleProps extends BoxProps { + color: string; + size: string; +} +export const ColoredCircle = ({ + color, + size, + ...props +}: ColoredCircleProps) => { + return ( + + ); +}; diff --git a/app/src/i18n/locales/en/dashboard.json b/app/src/i18n/locales/en/dashboard.json index 3179df525..c15f2f37e 100644 --- a/app/src/i18n/locales/en/dashboard.json +++ b/app/src/i18n/locales/en/dashboard.json @@ -171,5 +171,7 @@ "invite-error-toast-text": "There was an error sending your invitations", "afolu-other-agriculture": "Other agriculture", "afolu-livestock": "Live stock", - "afolu-land": "Land" + "afolu-land": "Land", + "rate": "rate", + "sector": "sector" }