From 5d986f560c55bb963d36cf0ffa5541c77c95d592 Mon Sep 17 00:00:00 2001 From: Dotty Date: Mon, 10 Jun 2024 17:27:26 -0400 Subject: [PATCH] delete polygon Panel Item --- .../MapPolygonCheckPanelItem.tsx | 206 ------------------ .../MapPolygonPanel/MapPolygonPanelItem.tsx | 165 -------------- .../site/[uuid]/components/MockedData.ts | 60 ----- 3 files changed, 431 deletions(-) delete mode 100644 src/components/elements/MapPolygonPanel/MapPolygonCheckPanelItem.tsx delete mode 100644 src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx diff --git a/src/components/elements/MapPolygonPanel/MapPolygonCheckPanelItem.tsx b/src/components/elements/MapPolygonPanel/MapPolygonCheckPanelItem.tsx deleted file mode 100644 index 635f5a88a..000000000 --- a/src/components/elements/MapPolygonPanel/MapPolygonCheckPanelItem.tsx +++ /dev/null @@ -1,206 +0,0 @@ -import classNames from "classnames"; -import { DetailedHTMLProps, Dispatch, HTMLAttributes, SetStateAction, useState } from "react"; -import { When } from "react-if"; - -import Text from "@/components/elements/Text/Text"; -import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; -import ModalConfirm from "@/components/extensive/Modal/ModalConfirm"; -import ModalWithLogo from "@/components/extensive/Modal/ModalWithLogo"; -import ModalWithMap from "@/components/extensive/Modal/ModalWithMap"; -import { useModalContext } from "@/context/modal.provider"; - -import Button from "../Button/Button"; -import Menu from "../Menu/Menu"; -import { MENU_PLACEMENT_RIGHT_BOTTOM } from "../Menu/MenuVariant"; -import { StatusEnum } from "../Status/constants/statusMap"; - -export interface MapPolygonCheckPanelItemProps - extends DetailedHTMLProps, HTMLDivElement> { - uuid: string; - title: string; - isSelected?: boolean; - refContainer?: React.RefObject | null; - setEditPolygon?: Dispatch>; - status: string; - polygon?: string[]; -} - -const MapPolygonCheckPanelItem = ({ - title, - isSelected, - className, - refContainer, - setEditPolygon, - polygon, - status, - ...props -}: MapPolygonCheckPanelItemProps) => { - const { openModal, closeModal } = useModalContext(); - const [openCollapse, setOpenCollapse] = useState(true); - const openFormModalHandlerRequestPolygonSupport = () => { - openModal( - - ); - }; - const openFormModalHandlerAddCommentary = () => { - openModal( - - ); - }; - const openFormModalHandlerConfirm = () => { - openModal( - {}} - /> - ); - }; - - const itemsPrimaryMenu = [ - { - id: "1", - render: () => ( - - -   Edit Polygon - - ), - onClick: () => setEditPolygon?.(true) - }, - { - id: "2", - render: () => ( - - -   Zoom to - - ) - }, - { - id: "3", - render: () => ( - - -   Download - - ) - }, - { - id: "4", - render: () => ( - - ) - }, - { - id: "5", - render: () => ( - - ) - }, - { - id: "6", - render: () => ( - - ) - } - ]; - - const dynamicClasses = (status: string) => { - switch (status) { - case "Submitted": - return "bg-blue"; - case "Approved": - return "bg-green"; - case "Needs More Info": - return "bg-tertiary-600"; - case "Draft": - return "bg-pinkCustom"; - default: - return "bg-blue "; - } - }; - - return ( -
-
-
-
{" "} -
- - {title} - -
-
- - - - - - - -
-
- -
- {polygon?.map((item, index) => ( -
- - - {item} - -
- ))} -
-
-
-
- ); -}; - -export default MapPolygonCheckPanelItem; diff --git a/src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx b/src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx deleted file mode 100644 index 70b3854a1..000000000 --- a/src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx +++ /dev/null @@ -1,165 +0,0 @@ -import classNames from "classnames"; -import { DetailedHTMLProps, Dispatch, HTMLAttributes, SetStateAction } from "react"; - -import Text from "@/components/elements/Text/Text"; -import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; -import ModalConfirm from "@/components/extensive/Modal/ModalConfirm"; -import ModalWithLogo from "@/components/extensive/Modal/ModalWithLogo"; -import ModalWithMap from "@/components/extensive/Modal/ModalWithMap"; -import { useModalContext } from "@/context/modal.provider"; - -import Button from "../Button/Button"; -import Menu from "../Menu/Menu"; -import { MENU_PLACEMENT_RIGHT_BOTTOM } from "../Menu/MenuVariant"; -import { StatusEnum } from "../Status/constants/statusMap"; - -export interface MapPolygonPanelItemProps extends DetailedHTMLProps, HTMLDivElement> { - uuid: string; - title: string; - subtitle: string; - isSelected?: boolean; - refContainer?: React.RefObject | null; - setEditPolygon?: Dispatch>; -} - -const MapPolygonPanelItem = ({ - title, - subtitle, - isSelected, - className, - refContainer, - setEditPolygon, - ...props -}: MapPolygonPanelItemProps) => { - const { openModal, closeModal } = useModalContext(); - const openFormModalHandlerRequestPolygonSupport = () => { - openModal( - - ); - }; - - const openFormModalHandlerAddCommentary = () => { - openModal( - - ); - }; - - const openFormModalHandlerConfirm = () => { - openModal( - {}} - /> - ); - }; - - const itemsPrimaryMenu = [ - { - id: "1", - render: () => ( - - -   Edit Polygon - - ), - onClick: () => setEditPolygon?.(true) - }, - { - id: "2", - render: () => ( - - -   Zoom to - - ) - }, - { - id: "3", - render: () => ( - - -   Download - - ) - }, - { - id: "4", - render: () => ( - - ) - }, - { - id: "5", - render: () => ( - - ) - }, - { - id: "6", - render: () => ( - - ) - } - ]; - - return ( -
-
-
- -
- {title} - {subtitle} -
-
- - - -
-
-
-
- ); -}; - -export default MapPolygonPanelItem; diff --git a/src/pages/site/[uuid]/components/MockedData.ts b/src/pages/site/[uuid]/components/MockedData.ts index 82f67b376..056628fbc 100644 --- a/src/pages/site/[uuid]/components/MockedData.ts +++ b/src/pages/site/[uuid]/components/MockedData.ts @@ -1,6 +1,3 @@ -import { MapPolygonCheckPanelItemProps } from "@/components/elements/MapPolygonPanel/MapPolygonCheckPanelItem"; -import { MapPolygonPanelItemProps } from "@/components/elements/MapPolygonPanel/MapPolygonPanelItem"; - export const uploadImageData = [ { id: "1", name: "Images5.png", status: "We are processing your image", isVerified: true }, { id: "2", name: "Images4.png", status: "We are processing your image", isVerified: true }, @@ -43,60 +40,3 @@ export const commentariesItems = [ status: "Draft" } ]; - -export const PolygonData: MapPolygonPanelItemProps[] = [ - { - uuid: "1", - title: "Polygon 1", - subtitle: "Created 15/12/2023" - }, - { - uuid: "2", - title: "Polygon 2", - subtitle: "Created 15/12/2023" - }, - { - uuid: "3", - title: "Polygon 3", - subtitle: "Created 15/12/2023" - }, - { - uuid: "4", - title: "Polygon 4", - subtitle: "Created 15/12/2023" - }, - { - uuid: "5", - title: "Polygon 5", - subtitle: "Created 15/12/2023" - } -]; - -export const PolygonAvailableData: MapPolygonCheckPanelItemProps[] = [ - { - uuid: "1", - title: "Durrell", - status: "Submitted" - }, - { - uuid: "2", - title: "Ecofix", - status: "Approved" - }, - { - uuid: "3", - title: "Env Coffee Forest Forum", - status: "Needs More Info", - polygon: ["Not WGS 84 projection", "Not WGS 84 projection", "Overlapping polygons identified"] - }, - { - uuid: "4", - title: "Env Found Afr Sl", - status: "Submitted" - }, - { - uuid: "5", - title: "Justdiggit", - status: "Draft" - } -];