Skip to content

Commit dcd8d27

Browse files
[WEB-5472] refactor: project form #8472
1 parent c97e418 commit dcd8d27

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

apps/web/core/components/project/create/common-attributes.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ChangeEvent } from "react";
22
import type { UseFormSetValue } from "react-hook-form";
33
import { Controller, useFormContext } from "react-hook-form";
4-
import { Info } from "lucide-react";
4+
import { InfoIcon } from "@plane/propel/icons";
55
// plane imports
66
import { ETabIndices } from "@plane/constants";
77
import { useTranslation } from "@plane/i18n";
@@ -120,7 +120,7 @@ function ProjectCommonAttributes(props: Props) {
120120
className="text-13"
121121
position="right-start"
122122
>
123-
<Info className="absolute right-2 top-2.5 h-3 w-3 text-placeholder" />
123+
<InfoIcon className="absolute right-2 top-2.5 h-3 w-3 text-placeholder" />
124124
</Tooltip>
125125
<span className="text-11 text-danger-primary">{errors?.identifier?.message}</span>
126126
</div>

apps/web/core/components/project/create/header.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,21 @@ import { ProjectTemplateSelect } from "@/plane-web/components/projects/create/te
1818
type Props = {
1919
handleClose: () => void;
2020
isMobile?: boolean;
21-
handleFormChange?: () => void;
21+
handleFormOnChange?: () => void;
2222
isClosable?: boolean;
2323
handleTemplateSelect?: () => void;
24+
showActionButtons?: boolean;
2425
};
2526

2627
function ProjectCreateHeader(props: Props) {
27-
const { handleClose, isMobile = false, handleFormChange, isClosable = true, handleTemplateSelect } = props;
28+
const {
29+
handleClose,
30+
isMobile = false,
31+
handleFormOnChange,
32+
isClosable = true,
33+
handleTemplateSelect,
34+
showActionButtons = true,
35+
} = props;
2836
const { watch, control, setValue } = useFormContext<IProject>();
2937
const { t } = useTranslation();
3038
// derived values
@@ -40,9 +48,11 @@ function ProjectCreateHeader(props: Props) {
4048
alt={t("project_cover_image_alt")}
4149
className="absolute left-0 top-0 h-full w-full rounded-lg"
4250
/>
43-
<div className="absolute left-2.5 top-2.5">
44-
<ProjectTemplateSelect onClick={handleTemplateSelect} />
45-
</div>
51+
{showActionButtons && (
52+
<div className="absolute left-2.5 top-2.5">
53+
<ProjectTemplateSelect onClick={handleTemplateSelect} />
54+
</div>
55+
)}
4656
{isClosable && (
4757
<div className="absolute right-2 top-2 p-2">
4858
<button data-posthog="PROJECT_MODAL_CLOSE" type="button" onClick={handleClose} tabIndex={getIndex("close")}>
@@ -59,7 +69,7 @@ function ProjectCreateHeader(props: Props) {
5969
label={t("change_cover")}
6070
onChange={(data) => {
6171
onChange(data);
62-
handleFormChange?.();
72+
handleFormOnChange?.();
6373
}}
6474
control={control}
6575
value={value ?? null}
@@ -101,7 +111,7 @@ function ProjectCreateHeader(props: Props) {
101111
shouldDirty: true,
102112
});
103113
onChange(newLogoProps);
104-
handleFormChange?.();
114+
handleFormOnChange?.();
105115
setIsOpen(false);
106116
}}
107117
defaultIconColor={value?.in_use && value.in_use === "icon" ? value.icon?.color : undefined}

0 commit comments

Comments
 (0)