From 2abfe954952d454cfa1f9d91706e259a4b7d98f4 Mon Sep 17 00:00:00 2001 From: hongggy Date: Mon, 23 Dec 2024 16:08:13 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=EB=A7=88=EC=9A=B0=EC=8A=A4=20?= =?UTF-8?q?=EC=BB=A4=EC=84=9C=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/mouseTrail/CustomCursor.tsx | 2 +- src/app/components/mouseTrail/MouseTrail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/mouseTrail/CustomCursor.tsx b/src/app/components/mouseTrail/CustomCursor.tsx index c58e648b..cd7a7e54 100644 --- a/src/app/components/mouseTrail/CustomCursor.tsx +++ b/src/app/components/mouseTrail/CustomCursor.tsx @@ -12,7 +12,7 @@ export default function CustomCursor() { useEffect(() => { const updatePosition = (e: MouseEvent) => { - setPosition({ x: e.clientX + window.scrollX, y: e.clientY + window.scrollY }); + setPosition({ x: e.clientX, y: e.clientY }); }; window.addEventListener("mousemove", updatePosition); diff --git a/src/app/components/mouseTrail/MouseTrail.tsx b/src/app/components/mouseTrail/MouseTrail.tsx index 316b062a..e0749e0b 100644 --- a/src/app/components/mouseTrail/MouseTrail.tsx +++ b/src/app/components/mouseTrail/MouseTrail.tsx @@ -57,7 +57,7 @@ export default function MouseTrail() { position: "absolute", left: position.x, top: position.y, - transform: "translate(-50%, -50%)", + // transform: "translate(-50%, -50%)", pointerEvents: "none", }} > From 55964facc326b225611091785f965b3dbbe0d920 Mon Sep 17 00:00:00 2001 From: hongggy Date: Mon, 23 Dec 2024 16:14:42 +0900 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=EC=88=98=EC=A0=95=ED=95=98=EA=B8=B0?= =?UTF-8?q?=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=B2=84=ED=8A=BC=20=ED=99=9C?= =?UTF-8?q?=EC=84=B1=ED=99=94=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(workform)/work/[formId]/edit/page.tsx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx b/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx index c8e32313..41336f43 100644 --- a/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx +++ b/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx @@ -1,7 +1,7 @@ "use client"; // 워크폼 수정 페이지 (사장님) -import { useEffect, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { useParams, useRouter, useSearchParams } from "next/navigation"; import { FormProvider, useForm } from "react-hook-form"; import axios from "axios"; @@ -72,6 +72,29 @@ export default function EditFormPage() { } }, [albaFormDetailData, reset]); + const isComplete = useMemo(() => { + // 작성이 완료된 필드들: 기본값에서 변경된 경우를 확인 + return ( + currentValues.title && + currentValues.description && + currentValues.location && + currentValues.workStartDate && + currentValues.workEndDate && + currentValues.recruitmentStartDate && + currentValues.recruitmentEndDate && + currentValues.workStartTime && + currentValues.workEndTime && + currentValues.age && + currentValues.preferred && + currentValues.education && + currentValues.gender && + currentValues.numberOfPositions >= 0 && + currentValues.imageUrls.length > 0 && + currentValues.hourlyWage >= 10_030 && + (currentValues.workDays.length > 0 || currentValues.isNegotiableWorkDays) + ); + }, [currentValues]); + // 수정된 폼 제출 리액트쿼리 const mutation = useMutation({ mutationFn: async () => { @@ -170,7 +193,7 @@ export default function EditFormPage() { width="md" color="orange" className="h-[58px] w-full lg:h-[72px] lg:text-xl lg:leading-8" - disabled={!isDirty || !isValid} + disabled={!isDirty || !isComplete} onClick={handleSubmit(() => mutation.mutate())} > {mutation.isPending ? : "수정하기"} From d13e0ba7364c1f7d42d0473ad3c9ef823e7e31fb Mon Sep 17 00:00:00 2001 From: hongggy Date: Mon, 23 Dec 2024 16:20:00 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EB=AF=B8=EC=82=AC=EC=9A=A9=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(pages)/(workform)/work/[formId]/edit/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx b/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx index 41336f43..1fa0e929 100644 --- a/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx +++ b/src/app/(pages)/(workform)/work/[formId]/edit/page.tsx @@ -33,7 +33,7 @@ export default function EditFormPage() { const { reset, handleSubmit, - formState: { isDirty, isValid }, + formState: { isDirty }, } = methods; const queryClient = useQueryClient();