diff --git a/src/components/extensive/BlurContainer/BlurContainer.tsx b/src/components/extensive/BlurContainer/BlurContainer.tsx index 06fc2ef8d..1ef1a55aa 100644 --- a/src/components/extensive/BlurContainer/BlurContainer.tsx +++ b/src/components/extensive/BlurContainer/BlurContainer.tsx @@ -17,8 +17,8 @@ const BlurContainer = ({ isBlur, textInformation, children, ...props }: BlurCont return (
diff --git a/src/components/extensive/PageElements/Card/PageCard.tsx b/src/components/extensive/PageElements/Card/PageCard.tsx index 1f80cae64..3bd4faf1e 100644 --- a/src/components/extensive/PageElements/Card/PageCard.tsx +++ b/src/components/extensive/PageElements/Card/PageCard.tsx @@ -77,6 +77,7 @@ const PageCard = ({   = ({ selectedCountry }) => { - const t = useT(); - const dataToggle = ["Absolute", "Relative"]; - const dataToggleGraphic = ["Table", "Graphic"]; - const dashboardHeader = [ - { - label: "Trees Planted", - value: "12.2M" - }, - { - label: "Hectares Under Restoration", - value: "5,220 ha" - }, - { - label: "Jobs Created", - value: "23,000" - } - ]; - - return ( -
-
- - -
- - {t("results for:")} - - flag - - {t(selectedCountry?.data.label)} - -
-
- -
- {dashboardHeader.map((item, index) => ( -
- - {t(item.label)} - - -
- - {t(item.value)} - -
-
- ))} -
- - TerraFund’s MRV framework . Please refer to the linked MRV framework for details on how these numbers are sourced and verified.` - )} - > - - - - - - TerraFund’s MRV framework. TerraFund defines a job as a set of tasks and duties performed by one person aged 18 or over in exchange for monetary pay in line with living wage standards. All indicators in the Jobs Created category are disaggregated by number of women, number of men, and number of youths. Restoration Champions are required to report on jobs and volunteers every 6 months and provide additional documentation to verify employment. Please refer to the linked MRV framework for additional details on how these numbers are sourced and verified.` - )} - > -
- - -
-
- - -
- -
- - -
-
-
-
- {/* */} -
- ); -}; - -export default Country; diff --git a/src/pages/dashboard/about-us/index.page.tsx b/src/pages/dashboard/about-us/index.page.tsx index 1b2962add..2ab79e3e5 100644 --- a/src/pages/dashboard/about-us/index.page.tsx +++ b/src/pages/dashboard/about-us/index.page.tsx @@ -1,5 +1,7 @@ +import { useT } from "@transifex/react"; import { useEffect, useRef } from "react"; +import Button from "@/components/elements/Button/Button"; import Text from "@/components/elements/Text/Text"; import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; @@ -10,6 +12,8 @@ const Homepage = () => { const second = useRef(null); const third = useRef(null); + const t = useT(); + useEffect(() => { const elements = [first, second, third]; @@ -70,7 +74,7 @@ const Homepage = () => { organizations that grow trees, their financial and government partners, and the wider public – can access data and insights about projects that are tracked through  { Please note that the dashboard is pre-filtered upon page load to display only projects from the TerraFund Landscapes programme. Each project reports 12 times over six years. +
diff --git a/src/pages/dashboard/components/ContentOverview.tsx b/src/pages/dashboard/components/ContentOverview.tsx index f0e25d37f..fa70246f4 100644 --- a/src/pages/dashboard/components/ContentOverview.tsx +++ b/src/pages/dashboard/components/ContentOverview.tsx @@ -23,7 +23,6 @@ import { DashboardGetProjectsData } from "@/generated/apiSchemas"; import { HectaresUnderRestorationData } from "@/utils/dashboardUtils"; import { - HECTARES_UNDER_RESTORATION_SECTION_TOOLTIP, MAP_TOOLTIP, RESTORATION_STRATEGIES_REPRESENTED_TOOLTIP, TARGET_LAND_USE_TYPES_REPRESENTED_TOOLTIP, @@ -233,9 +232,8 @@ const ContentOverview = (props: ContentOverviewProps) => { gap={8} isUserAllowed={isUserAllowed} subtitleMore={true} - title={t("Hectares Under Restoration")} + title={t("HECTARES UNDER RESTORATION")} variantSubTitle="text-14-light" - tooltip={t(HECTARES_UNDER_RESTORATION_SECTION_TOOLTIP)} iconClassName="h-3.5 w-3.5 text-darkCustom lg:h-5 lg:w-5" subtitle={t( `The numbers and reports below display data related to Indicator 2: Hectares Under Restoration described in TerraFund’s MRV framework. Please refer to the linked MRV framework for details on how these numbers are sourced and verified.` diff --git a/src/pages/dashboard/components/ObjectiveSec.tsx b/src/pages/dashboard/components/ObjectiveSec.tsx index 1a40a34fa..199e8e46c 100644 --- a/src/pages/dashboard/components/ObjectiveSec.tsx +++ b/src/pages/dashboard/components/ObjectiveSec.tsx @@ -4,7 +4,32 @@ import { When } from "react-if"; import Text from "@/components/elements/Text/Text"; -import { DashboardDataProps } from "../project/index.page"; +export interface DashboardTableDataProps { + label: string; + valueText: string; + value: number; +} + +export interface GraphicLegendProps { + label: string; + value: string; + color: string; +} +export interface DashboardDataProps { + value?: number; + unit?: string; + secondValue?: string; + graphic?: string; + tableData?: DashboardTableDataProps[]; + maxValue?: number; + totalSection?: { numberOfSites: number; totalHectaresRestored: number }; + graphicLegend?: GraphicLegendProps[]; + graphicTargetLandUseTypes?: DashboardTableDataProps[]; + objetiveText?: string; + preferredLanguage?: string; + landTenure?: string; + totalValue?: number; +} const ObjectiveSec = ({ data }: { data: DashboardDataProps }) => { const t = useT(); diff --git a/src/pages/dashboard/components/SecDashboard.tsx b/src/pages/dashboard/components/SecDashboard.tsx index 880e06c0f..17e5d2501 100644 --- a/src/pages/dashboard/components/SecDashboard.tsx +++ b/src/pages/dashboard/components/SecDashboard.tsx @@ -27,9 +27,9 @@ import GroupedBarChart from "../charts/GroupedBarChart"; import HorizontalStackedBarChart from "../charts/HorizontalStackedBarChart"; import MultiLineChart from "../charts/MultiLineChart"; import SimpleBarChart from "../charts/SimpleBarChart"; -import { DashboardDataProps } from "../project/index.page"; import GraphicDashboard from "./GraphicDashboard"; import GraphicIconDashboard from "./GraphicIconDashboard"; +import { DashboardDataProps } from "./ObjectiveSec"; import ObjectiveSec from "./ObjectiveSec"; import ValueNumberDashboard from "./ValueNumberDashboard"; @@ -262,7 +262,7 @@ const SecDashboard = ({ /> {t("VIEW ALL PROJECTS")} diff --git a/src/pages/dashboard/index.page.tsx b/src/pages/dashboard/index.page.tsx index 1e2b584c6..83b6edbda 100644 --- a/src/pages/dashboard/index.page.tsx +++ b/src/pages/dashboard/index.page.tsx @@ -36,15 +36,10 @@ import { NUMBER_OF_TREES_PLANTED_BY_YEAR_TOOLTIP, TOP_5_PROJECTS_WITH_MOST_PLANTED_TREES_TOOLTIP, TOTAL_VOLUNTEERS_TOOLTIP, - TREES_RESTORED_SECTION_TOOLTIP, VOLUNTEERS_CREATED_BY_AGE_TOOLTIP, VOLUNTEERS_CREATED_BY_GENDER_TOOLTIP } from "./constants/tooltips"; -import { - JOBS_CREATED_SECTION_TOOLTIP, - NO_DATA_PRESENT_ACTIVE_PROJECT_TOOLTIPS, - NUMBER_OF_TREES_PLANTED_TOOLTIP -} from "./constants/tooltips"; +import { NO_DATA_PRESENT_ACTIVE_PROJECT_TOOLTIPS, NUMBER_OF_TREES_PLANTED_TOOLTIP } from "./constants/tooltips"; import { useDashboardData } from "./hooks/useDashboardData"; import { LABEL_LEGEND } from "./mockedData/dashboard"; @@ -352,8 +347,7 @@ const Dashboard = () => { gap={8} subtitleMore={true} isUserAllowed={isUserAllowed?.allowed} - title={t("Trees Restored")} - tooltip={t(TREES_RESTORED_SECTION_TOOLTIP)} + title={t("TREES RESTORED")} widthTooltip="w-52 lg:w-64" iconClassName="h-3.5 w-3.5 text-darkCustom lg:h-5 lg:w-5" variantSubTitle="text-14-light" @@ -403,7 +397,6 @@ const Dashboard = () => { tooltipTrigger="click" widthTooltip="w-80 lg:w-96" iconClassName="h-3.5 w-3.5 text-darkCustom lg:h-5 lg:w-5" - tooltip={t(JOBS_CREATED_SECTION_TOOLTIP)} subtitle={t( `The numbers and reports below display data related to Indicator 3: Jobs Created described in TerraFund's MRV framework. TerraFund defines a job as a set of tasks and duties performed by one person aged 18 or over in exchange for monetary pay in line with living wage standards. All indicators in the Jobs Created category are disaggregated by number of women, number of men, and number of youths. Restoration Champions are required to report on jobs and volunteers every 6 months and provide additional documentation to verify employment. Please refer to the linked MRV framework for additional details on how these numbers are sourced and verified.` )} diff --git a/src/pages/dashboard/project/index.page.tsx b/src/pages/dashboard/project/index.page.tsx deleted file mode 100644 index e2c33f1ab..000000000 --- a/src/pages/dashboard/project/index.page.tsx +++ /dev/null @@ -1,314 +0,0 @@ -import { useT } from "@transifex/react"; -import { useContext } from "react"; - -import Breadcrumbs from "@/components/elements/Breadcrumbs/Breadcrumbs"; -import Text from "@/components/elements/Text/Text"; -import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; -import PageCard from "@/components/extensive/PageElements/Card/PageCard"; -import PageRow from "@/components/extensive/PageElements/Row/PageRow"; - -import ContentOverview from "../components/ContentOverview"; -import SecDashboard from "../components/SecDashboard"; -import { - ACTIVE_PROJECTS_TOOLTIP, - HECTARES_UNDER_RESTORATION_TOOLTIP, - JOBS_CREATED_BY_AGE_TOOLTIP, - JOBS_CREATED_BY_GENDER_TOOLTIP, - JOBS_CREATED_SECTION_TOOLTIP, - JOBS_CREATED_TOOLTIP, - NEW_FULL_TIME_JOBS_TOOLTIP, - NEW_PART_TIME_JOBS_TOOLTIP, - NUMBER_OF_TREES_PLANTED_BY_YEAR_TOOLTIP, - NUMBER_OF_TREES_PLANTED_TOOLTIP, - TOP_5_PROJECTS_WITH_MOST_PLANTED_TREES_TOOLTIP, - TOTAL_VOLUNTEERS_TOOLTIP, - TREES_PLANTED_TOOLTIP, - TREES_RESTORED_SECTION_TOOLTIP, - VOLUNTEERS_CREATED_BY_AGE_TOOLTIP, - VOLUNTEERS_CREATED_BY_GENDER_TOOLTIP -} from "../constants/tooltips"; -import { RefContext } from "../context/ScrollContext.provider"; -import { - JOBS_CREATED_BY_AGE, - JOBS_CREATED_BY_GENDER, - LABEL_LEGEND, - NEW_FULL_TIME_JOBS, - NEW_PART_TIME_JOBS, - NUMBER_OF_TREES_PLANTED, - NUMBER_OF_TREES_PLANTED_BY_YEAR, - OBJETIVE, - TOP_10_PROJECTS_WITH_THE_MOST_PLANTED_TREES, - TOTAL_VOLUNTEERS, - VOLUNTEERS_CREATED_BY_AGE, - VOLUNTEERS_CREATED_BY_GENDER -} from "../mockedData/dashboard"; - -export interface DashboardTableDataProps { - label: string; - valueText: string; - value: number; -} - -export interface GraphicLegendProps { - label: string; - value: string; - color: string; -} - -export interface DashboardDataProps { - value?: number; - unit?: string; - secondValue?: string; - graphic?: string; - tableData?: DashboardTableDataProps[]; - maxValue?: number; - totalSection?: { numberOfSites: number; totalHectaresRestored: number }; - graphicLegend?: GraphicLegendProps[]; - graphicTargetLandUseTypes?: DashboardTableDataProps[]; - objetiveText?: string; - preferredLanguage?: string; - landTenure?: string; - totalValue?: number; -} - -const ProjectView = () => { - const t = useT(); - const dataToggle = ["Absolute", "Relative"]; - const dataToggleGraphic = ["Table", "Graphic"]; - const sharedRef = useContext(RefContext); - const dashboardHeader = [ - { - label: "Trees Planted", - value: "0", - tooltip: TREES_PLANTED_TOOLTIP - }, - { - label: "Hectares Under Restoration", - value: "0 ha", - tooltip: HECTARES_UNDER_RESTORATION_TOOLTIP - }, - { - label: "Jobs Created", - value: "0", - tooltip: JOBS_CREATED_TOOLTIP - } - ]; - - const COLUMN_ACTIVE_COUNTRY = [ - { - header: "Project", - accessorKey: "project", - enableSorting: false - }, - { - header: "Trees Planted", - accessorKey: "treesPlanted", - enableSorting: false - }, - { - header: "Hectares", - accessorKey: "restoratioHectares", - enableSorting: false - }, - { - header: "Jobs Created", - accessorKey: "jobsCreated", - enableSorting: false - }, - { - header: "Volunteers", - accessorKey: "volunteers", - enableSorting: false - }, - { - header: "", - accessorKey: "link", - enableSorting: false, - cell: () => { - return ( - - - - ); - } - } - ]; - - return ( -
-
- -
- -
- -
- {dashboardHeader.map((item, index) => ( -
- - {t(item.label)} - - -
- - {t(item.value)} - -
-
- ))} -
- - -
- tree -
- {t("Restoration of Degraded Forest Lands in Ghana - PADO")} - - {t("Operations: Niger")} - - {t("Registration: Niger")} - - {t(" Organization: Non-Profit")} - -
-
- -
- - TerraFund’s MRV framework . Please refer to the linked MRV framework for details on how these numbers are sourced and verified.` - )} - > - - - - - TerraFund’s MRV framework. TerraFund defines a job as a set of tasks and duties performed by one person aged 18 or over in exchange for monetary pay in line with living wage standards. All indicators in the Jobs Created category are disaggregated by number of women, number of men, and number of youths. Restoration Champions are required to report on jobs and volunteers every 6 months and provide additional documentation to verify employment. Please refer to the linked MRV framework for additional details on how these numbers are sourced and verified.` - )} - > -
- - -
-
- - -
- -
- - -
-
-
-
- -
- ); -}; - -export default ProjectView;