Skip to content

Commit

Permalink
[TM-874] solved PR - add transifex and remove mocked data
Browse files Browse the repository at this point in the history
  • Loading branch information
dottyy committed Jun 12, 2024
1 parent 02249ca commit 02017fc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const ChecklistInformation = () => {
<ModalWithMap
title={t("Request Support")}
onClose={closeModal}
primaryButtonText="Submit"
primaryButtonText={t("Submit")}
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
></ModalWithMap>
);
Expand Down
35 changes: 19 additions & 16 deletions src/components/elements/MapPolygonPanel/MapPolygonPanelItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useT } from "@transifex/react";
import classNames from "classnames";
import { DetailedHTMLProps, Dispatch, HTMLAttributes, SetStateAction } from "react";

Expand Down Expand Up @@ -32,35 +33,37 @@ const MapPolygonPanelItem = ({
...props
}: MapPolygonPanelItemProps) => {
const { openModal, closeModal } = useModalContext();
const t = useT();

const openFormModalHandlerRequestPolygonSupport = () => {
openModal(
<ModalWithMap
title="Request Support"
title={t("Request Support")}
onClose={closeModal}
content="Faja Lobi Project&nbsp;&nbsp;•&nbsp;&nbsp;Priceless Planet Coalition"
primaryButtonText="Submit"
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonText={t("Submit")}
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
></ModalWithMap>
);
};
const openFormModalHandlerAddCommentary = () => {
openModal(
<ModalWithLogo
title="Blue Forest"
title={t("Blue Forest")}
onClose={closeModal}
status={StatusEnum.UNDER_REVIEW}
toogleButton
content="Faja Lobi Project&nbsp;&nbsp;•&nbsp;&nbsp;Priceless Planet Coalition"
primaryButtonText="Close"
content="-&nbsp;&nbsp;•&nbsp;&nbsp;-"
primaryButtonText={t("Close")}
primaryButtonProps={{ className: "px-8 py-3", variant: "primary", onClick: closeModal }}
/>
);
};
const openFormModalHandlerConfirm = () => {
openModal(
<ModalConfirm
title={"Confirm Polygon Deletion"}
content="Do you want to delete this polygon?"
title={t("Confirm Polygon Deletion")}
content={t("Do you want to delete this polygon?")}
onClose={closeModal}
onConfirm={() => {}}
/>
Expand All @@ -73,7 +76,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.IC_SITE_VIEW} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; Edit Polygon
&nbsp; {t("Edit Polygon")}
</Text>
),
onClick: () => {
Expand All @@ -87,7 +90,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.SEARCH} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; Zoom to
&nbsp; {t("Zoom to")}
</Text>
)
},
Expand All @@ -96,7 +99,7 @@ const MapPolygonPanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.DOWNLOAD_PA} className="h-5 w-5 lg:h-6 lg:w-6" />
&nbsp; Download
&nbsp; {t("Download")}
</Text>
)
},
Expand All @@ -106,7 +109,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerAddCommentary}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.COMMENT} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Comment
&nbsp; {t("Comment")}
</Text>
</Button>
)
Expand All @@ -117,7 +120,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerRequestPolygonSupport}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.REQUEST} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Request Support
&nbsp; {t("Request Support")}
</Text>
</Button>
)
Expand All @@ -128,7 +131,7 @@ const MapPolygonPanelItem = ({
<Button variant="text" onClick={openFormModalHandlerConfirm}>
<Text variant="text-14-semibold" className="flex items-center">
<Icon name={IconNames.TRASH_PA} className="h-5 w-5 lg:h-6 lg:w-6 " />
&nbsp; Delete Polygon
&nbsp; {t("Delete Polygon")}
</Text>
</Button>
)
Expand All @@ -148,9 +151,9 @@ const MapPolygonPanelItem = ({
<Icon name={IconNames.MAP_THUMBNAIL} className="h-11 w-11 rounded-lg bg-neutral-300" />
<div className="flex flex-1 flex-col">
<Text variant="text-14-bold" className="">
{title}
{t(title)}
</Text>
<Text variant="text-14-light">{subtitle}</Text>
<Text variant="text-14-light">{t(subtitle)}</Text>
</div>
<div className="lex h-full self-start">
<Menu container={refContainer?.current} placement={MENU_PLACEMENT_RIGHT_BOTTOM} menu={itemsPrimaryMenu}>
Expand Down

0 comments on commit 02017fc

Please sign in to comment.