Skip to content

Commit

Permalink
[TM-850] fix Status Enum in Modal Add
Browse files Browse the repository at this point in the history
  • Loading branch information
egrojMonroy committed Jun 10, 2024
1 parent bc32ba1 commit fb2e118
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/components/extensive/Modal/ModalApprove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { When } from "react-if";

import Button from "@/components/elements/Button/Button";
import Checkbox from "@/components/elements/Inputs/Checkbox/Checkbox";
// import Status from "@/components/elements/Status/Status";
import { StatusEnum } from "@/components/elements/Status/constants/statusMap";
import Status from "@/components/elements/Status/Status";
import Text from "@/components/elements/Text/Text";

import Icon, { IconNames } from "../Icon/Icon";
Expand All @@ -16,7 +17,7 @@ export interface ModalApproveProps extends ModalProps {
primaryButtonText?: string;
secondaryButtonText?: string;
toogleButton?: boolean;
status?: "under-review" | "approved" | "draft" | "submitted";
status?: StatusEnum;
onClose?: () => void;
}

Expand All @@ -41,7 +42,7 @@ const ModalApprove: FC<ModalApproveProps> = ({
<Icon name={IconNames.WRI_LOGO} width={108} height={30} className="min-w-[108px]" />
<div className="flex items-center">
<When condition={status}>
{/* <Status status={status ?? "draft"} className="rounded px-2 py-[2px]" textVariant="text-14-bold" /> */}
<Status status={status ?? StatusEnum.DRAFT} className="rounded px-2 py-[2px]" textVariant="text-14-bold" />
</When>
<button onClick={onClose} className="ml-2 rounded p-1 hover:bg-grey-800">
<Icon name={IconNames.CLEAR} width={16} height={16} className="text-darkCustom-100" />
Expand Down
7 changes: 4 additions & 3 deletions src/components/extensive/Modal/ModalSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { When } from "react-if";

import Button from "@/components/elements/Button/Button";
import Checkbox from "@/components/elements/Inputs/Checkbox/Checkbox";
// import Status from "@/components/elements/Status/Status";
import { StatusEnum } from "@/components/elements/Status/constants/statusMap";
import Status from "@/components/elements/Status/Status";
import Text from "@/components/elements/Text/Text";

import Icon, { IconNames } from "../Icon/Icon";
Expand All @@ -16,7 +17,7 @@ export interface ModalSubmitProps extends ModalProps {
primaryButtonText?: string;
secondaryButtonText?: string;
toogleButton?: boolean;
status?: "under-review" | "approved" | "draft" | "submitted";
status?: StatusEnum;
onClose?: () => void;
}

Expand All @@ -42,7 +43,7 @@ const ModalSubmit: FC<ModalSubmitProps> = ({
<Icon name={IconNames.WRI_LOGO} width={108} height={30} className="min-w-[108px]" />
<div className="flex items-center">
<When condition={status}>
{/* <Status status={status ?? "draft"} className="rounded px-2 py-[2px]" textVariant="text-14-bold" /> */}
<Status status={status ?? StatusEnum.DRAFT} className="rounded px-2 py-[2px]" textVariant="text-14-bold" />
</When>
<button onClick={onClose} className="ml-2 rounded p-1 hover:bg-grey-800">
<Icon name={IconNames.CLEAR} width={16} height={16} className="text-darkCustom-100" />
Expand Down
11 changes: 8 additions & 3 deletions src/components/extensive/Modal/ModalWithLogo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import Button from "@/components/elements/Button/Button";
import Commentary from "@/components/elements/Commentary/Commentary";
import CommentaryBox from "@/components/elements/CommentaryBox/CommentaryBox";
import StepProgressbar from "@/components/elements/ProgressBar/StepProgressbar/StepProgressbar";
// import Status from "@/components/elements/Status/Status";
import { StatusEnum } from "@/components/elements/Status/constants/statusMap";
import Status from "@/components/elements/Status/Status";
import Text from "@/components/elements/Text/Text";

import Icon, { IconNames } from "../Icon/Icon";
Expand All @@ -19,7 +20,7 @@ export interface ModalWithLogoProps extends ModalProps {
primaryButtonText?: string;
secondaryButtonText?: string;
toogleButton?: boolean;
status?: "under-review" | "approved" | "draft" | "submitted";
status?: StatusEnum;
onClose?: () => void;
}

Expand All @@ -46,7 +47,11 @@ const ModalWithLogo: FC<ModalWithLogoProps> = ({
<Icon name={IconNames.WRI_LOGO} width={108} height={30} className="min-w-[108px]" />
<div className="flex items-center">
<When condition={status}>
{/* <Status status={status ? status : "draft"} className="rounded px-2 py-[2px]" textVariant="text-14-bold" /> */}
<Status
status={status ? status : StatusEnum.DRAFT}
className="rounded px-2 py-[2px]"
textVariant="text-14-bold"
/>
</When>
<button onClick={onClose} className="ml-2 rounded p-1 hover:bg-grey-800">
<Icon name={IconNames.CLEAR} width={16} height={16} className="text-darkCustom-100" />
Expand Down
9 changes: 6 additions & 3 deletions src/components/extensive/Modal/ModalWithMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { VARIANT_FILE_INPUT_MODAL_ADD_IMAGES_WITH_MAP } from "@/components/eleme
import TextArea from "@/components/elements/Inputs/textArea/TextArea";
import Map from "@/components/elements/Map-mapbox/Map";
import StepProgressbar from "@/components/elements/ProgressBar/StepProgressbar/StepProgressbar";
// import Status from "@/components/elements/Status/Status";
import { StatusEnum } from "@/components/elements/Status/constants/statusMap";
import Status from "@/components/elements/Status/Status";
import Text from "@/components/elements/Text/Text";
import { UploadedFile } from "@/types/common";

Expand All @@ -21,7 +22,7 @@ import { ModalBaseWithMap } from "./ModalsBases";
export interface ModalWithMapProps extends ModalProps {
polygonSelected?: string;
primaryButtonText?: string;
status?: "under-review" | "approved" | "draft" | "submitted";
status?: StatusEnum;
onClose?: () => void;
}

Expand All @@ -47,7 +48,9 @@ const ModalWithMap: FC<ModalWithMapProps> = ({
<header className="flex w-full items-center justify-between border-b border-b-neutral-200 px-8 py-5">
<Icon name={IconNames.WRI_LOGO} width={108} height={30} className="min-w-[108px]" />
<div className="flex items-center">
<When condition={status}>{/* <Status status={status ?? "draft"} /> */}</When>
<When condition={status}>
<Status status={status ?? StatusEnum.DRAFT} />
</When>
</div>
</header>
<div className="max-h-[100%] w-full flex-[1_1_0] overflow-auto px-8 py-8">
Expand Down

0 comments on commit fb2e118

Please sign in to comment.