Skip to content

Commit

Permalink
[TM-906] add transifex and edit classNames
Browse files Browse the repository at this point in the history
  • Loading branch information
dottyy committed Jun 11, 2024
1 parent b0a0f86 commit e87f5d7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 19 deletions.
5 changes: 4 additions & 1 deletion src/admin/components/ResourceTabs/InformationTab/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Card, Grid, Stack, Typography } from "@mui/material";
import { useT } from "@transifex/react";
import classNames from "classnames";
import { FC } from "react";
import { TabbedShowLayout, TabProps, useShowContext } from "react-admin";
import { Else, If, Then, When } from "react-if";
Expand Down Expand Up @@ -117,7 +118,9 @@ const InformationTab: FC<IProps> = props => {
<Stack gap={4}>
<Card sx={{ padding: 4 }} className="!shadow-none">
<List
className={`${props.type == "sites" && "map-span-3"} space-y-12`}
className={classNames("space-y-12", {
"map-span-3": props.type === "sites"
})}
items={formSteps}
render={(step, index) => (
<InformationTabRow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useT } from "@transifex/react";
import classNames from "classnames";
import { useState } from "react";
import { useShowContext } from "react-admin";

Expand Down Expand Up @@ -213,9 +214,9 @@ const StatusDisplay = ({
}, 3000);
console.error(e);
} finally {
refresh && refresh();
reloadEntity && reloadEntity();
closeModal;
refresh?.();
reloadEntity?.();
closeModal?.();
}
}}
/>
Expand Down Expand Up @@ -273,9 +274,9 @@ const StatusDisplay = ({
}, 3000);
console.error(e);
} finally {
refresh && refresh();
reloadEntity && reloadEntity();
closeModal;
refresh?.();
reloadEntity?.();
closeModal?.();
}
}}
/>
Expand All @@ -291,7 +292,7 @@ const StatusDisplay = ({
<Button
disabled={tab == "polygonReview"}
variant="semi-black"
className={`w-full flex-1 whitespace-nowrap ${tab == "polygonReview" ? "opacity-0" : ""}`}
className={classNames("w-full flex-1 whitespace-nowrap", { "opacity-0": tab === "polygonReview" })}
onClick={openFormModalHandlerRequest}
>
<Text variant="text-12-bold">{t("Change Request")}</Text>
Expand Down
10 changes: 6 additions & 4 deletions src/components/elements/MapSidePanel/MapSidePanelItem.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, HTMLAttributes } from "react";

Expand Down Expand Up @@ -31,14 +32,15 @@ const MapSidePanelItem = ({
...props
}: MapSidePanelItemProps) => {
let imageStatus = `IC_${status.toUpperCase().replace(/-/g, "_")}`;
const t = useT();

const itemsPrimaryMenu = [
{
id: "1",
render: () => (
<Text variant="text-14-semibold" className="flex items-center" onClick={() => setClickedButton("site")}>
<Icon name={IconNames.IC_SITE_VIEW} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; View Site
&nbsp; {t("View Site")}
</Text>
)
},
Expand All @@ -47,7 +49,7 @@ const MapSidePanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center" onClick={() => setClickedButton("zoomTo")}>
<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 @@ -56,7 +58,7 @@ const MapSidePanelItem = ({
render: () => (
<Text variant="text-14-semibold" className="flex items-center" onClick={() => setClickedButton("download")}>
<Icon name={IconNames.IC_DOWNLOAD_MENU} className="h-4 w-4 lg:h-5 lg:w-5" />
&nbsp; Download
&nbsp; {t("Download")}
</Text>
)
}
Expand All @@ -78,7 +80,7 @@ const MapSidePanelItem = ({
/>
<div className="flex flex-1 flex-col">
<Text variant="text-14-bold" className="">
{title}
{t(title)}
</Text>
<Text variant="text-14-light">{subtitle}</Text>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/extensive/Modal/ModalSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ const ModalSubmit: FC<ModalSubmitProps> = ({
/>
</When>
<div className="flex items-center justify-between">
<Text variant="text-24-bold">{title}</Text>
<Text variant="text-24-bold">{t(title)}</Text>
</div>
<When condition={!!content}>
<Text as="div" variant="text-12-light" className="mt-1 mb-4" containHtml>
{content}
{t(content)}
</Text>
</When>
<div className="mb-6 flex flex-col rounded-lg border border-grey-750">
Expand Down
6 changes: 3 additions & 3 deletions src/components/extensive/Modal/ModalWithMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ const ModalWithMap: FC<ModalWithMapProps> = ({
</header>
<div className="max-h-[100%] w-full flex-[1_1_0] overflow-auto px-8 py-8">
<div className="flex items-center justify-between">
<Text variant="text-24-bold">{title}</Text>
<Text variant="text-24-bold">{t(title)}</Text>
</div>
<When condition={!!content}>
<Text as="div" variant="text-12-bold" className="mt-1 mb-8" containHtml>
{content}
{t(content)}
</Text>
</When>
<div className="mb-[72px]">
Expand Down Expand Up @@ -137,7 +137,7 @@ const ModalWithMap: FC<ModalWithMapProps> = ({
<div className="flex w-full justify-end px-8 py-4">
<Button {...primaryButtonProps}>
<Text variant="text-14-bold" className="capitalize text-white">
{primaryButtonText}
{t(primaryButtonText)}
</Text>
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const PastRestorationExperience = ({ organization }: PastRestorationExperiencePr
}

return (
<section className="my-10 rounded-lg bg-neutral-150 p-8">
<section className="my-10 rounded-lg bg-neutral-150 p-8">
<Text variant="text-heading-300">{t("Environmental Impact")}</Text>
<div className="mt-10 flex flex-col gap-4">
<TextRow
Expand Down Expand Up @@ -90,7 +90,7 @@ const PastRestorationExperience = ({ organization }: PastRestorationExperiencePr
<div>
<Text variant="text-body-900" className="w-1/3">
<>
Historic Monitoring Shapefile Upload:
{t("Historic Monitoring Shapefile Upload:")}
<br />
<br />
</>
Expand Down

0 comments on commit e87f5d7

Please sign in to comment.