From 66a4fa63a5672e7ea5990477a0618a7dfb95d712 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:35:56 +0900 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20=EC=9D=B8=EC=A6=9D=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EA=B4=80=EB=A0=A8=20=EC=83=81=EC=88=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20(=ED=8C=8C=EC=9D=BC=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EC=A0=9C=ED=95=9C=20=EB=B0=8F=20=ED=97=88=EC=9A=A9=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=ED=83=80=EC=9E=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/certification-file.ts | 11 +++++++++++ src/features/realtor-certification/constants/index.ts | 1 + 2 files changed, 12 insertions(+) create mode 100644 src/features/realtor-certification/constants/certification-file.ts create mode 100644 src/features/realtor-certification/constants/index.ts diff --git a/src/features/realtor-certification/constants/certification-file.ts b/src/features/realtor-certification/constants/certification-file.ts new file mode 100644 index 0000000..4d6560a --- /dev/null +++ b/src/features/realtor-certification/constants/certification-file.ts @@ -0,0 +1,11 @@ +// 파일 크기 제한 (10MB) +export const MAX_FILE_SIZE_10MB = 10 * 1024 * 1024; + +// 허용되는 파일 타입 +export const ACCEPTED_FILE_TYPES = [ + 'application/pdf', + 'image/jpeg', + 'image/jpg', + 'image/png', + 'image/webp', +]; diff --git a/src/features/realtor-certification/constants/index.ts b/src/features/realtor-certification/constants/index.ts new file mode 100644 index 0000000..c217c59 --- /dev/null +++ b/src/features/realtor-certification/constants/index.ts @@ -0,0 +1 @@ +export * from './certification-file'; From 0dbb9c6f95183e588d9233eb4cf6ecef9d830246 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:36:21 +0900 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20=EB=B6=80=EB=8F=99=EC=82=B0=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=B0=8F=20=ED=8C=8C=EC=9D=BC=20=EC=97=85=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/index.ts | 1 + .../components/common/CustomFileUpload.tsx | 143 ++++++++++++++++++ .../components/common/index.ts | 1 + .../realtor-certification/components/index.ts | 2 + src/features/realtor-certification/index.ts | 1 + 5 files changed, 148 insertions(+) create mode 100644 src/features/realtor-certification/components/common/CustomFileUpload.tsx create mode 100644 src/features/realtor-certification/components/common/index.ts create mode 100644 src/features/realtor-certification/components/index.ts create mode 100644 src/features/realtor-certification/index.ts diff --git a/src/features/index.ts b/src/features/index.ts index ab7f184..0de3346 100644 --- a/src/features/index.ts +++ b/src/features/index.ts @@ -1,2 +1,3 @@ export * from './main'; export * from './login'; +export * from './realtor-certification'; diff --git a/src/features/realtor-certification/components/common/CustomFileUpload.tsx b/src/features/realtor-certification/components/common/CustomFileUpload.tsx new file mode 100644 index 0000000..1ec9713 --- /dev/null +++ b/src/features/realtor-certification/components/common/CustomFileUpload.tsx @@ -0,0 +1,143 @@ +import { useRef } from 'react'; +import { useFormContext } from 'react-hook-form'; + +import { cn } from '@/shared'; + +import { type RealtorCertificationFormData } from '../../model'; + +interface CustomFileUploadProps { + name: keyof RealtorCertificationFormData; + label?: string; + placeholder?: string; + className?: string; + disabled?: boolean; + error?: string; +} + +export const CustomFileUpload = ({ + name, + label, + placeholder = '파일을 선택하거나 여기에 드래그하세요', + className, + disabled, + error, +}: CustomFileUploadProps) => { + const form = useFormContext(); + const fileInputRef = useRef(null); + + const updateFile = (file: File | null) => { + form.setValue(name, file as RealtorCertificationFormData[keyof RealtorCertificationFormData]); + form.trigger(name); + }; + + const handleInputChange = (event: React.ChangeEvent) => { + const file = event.target.files?.[0] || null; + updateFile(file); + }; + + const handleDragOver = (event: React.DragEvent) => { + event.preventDefault(); + event.currentTarget.classList.add('border-blue-500', 'bg-blue-50'); + }; + + const handleDragLeave = (event: React.DragEvent) => { + event.preventDefault(); + event.currentTarget.classList.remove('border-blue-500', 'bg-blue-50'); + }; + + const handleDrop = (event: React.DragEvent) => { + event.preventDefault(); + event.currentTarget.classList.remove('border-blue-500', 'bg-blue-50'); + + const file = event.dataTransfer.files[0] || null; + updateFile(file); + }; + + const handleClick = () => { + fileInputRef.current?.click(); + }; + + const selectedFile = form.watch(name) as File | null; + + return ( +
+ {label && } + +
+ + + {selectedFile ? ( +
+
+ + + +
+
+

{selectedFile.name}

+

+ {(selectedFile.size / 1024 / 1024).toFixed(2)} MB +

+
+

클릭하여 다른 파일 선택

+
+ ) : ( +
+
+ + + +
+
+

+ 클릭하여 파일 선택 + 또는 드래그 앤 드롭 +

+

{placeholder}

+
+
지원 형식: PDF, JPG, PNG, WEBP (최대 10MB)
+
+ )} +
+ + {error &&

{error}

} +
+ ); +}; diff --git a/src/features/realtor-certification/components/common/index.ts b/src/features/realtor-certification/components/common/index.ts new file mode 100644 index 0000000..39b1e32 --- /dev/null +++ b/src/features/realtor-certification/components/common/index.ts @@ -0,0 +1 @@ +export * from './CustomFileUpload'; diff --git a/src/features/realtor-certification/components/index.ts b/src/features/realtor-certification/components/index.ts new file mode 100644 index 0000000..1aacf69 --- /dev/null +++ b/src/features/realtor-certification/components/index.ts @@ -0,0 +1,2 @@ +export * from './common'; +export * from './features'; diff --git a/src/features/realtor-certification/index.ts b/src/features/realtor-certification/index.ts new file mode 100644 index 0000000..5ecdd1f --- /dev/null +++ b/src/features/realtor-certification/index.ts @@ -0,0 +1 @@ +export * from './ui'; From fbc61e5e9770b4ec2e613c268d915929aafb5afb Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:36:35 +0900 Subject: [PATCH 03/11] =?UTF-8?q?feat:=20=EB=B6=80=EB=8F=99=EC=82=B0=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=20=EC=8A=A4=ED=82=A4=EB=A7=88=20=EB=B0=8F=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=AA=A8=EB=93=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../realtor-certification/model/index.ts | 1 + .../realtor-certification/model/schema/index.ts | 1 + .../model/schema/realtor-certification.schema.ts | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 src/features/realtor-certification/model/index.ts create mode 100644 src/features/realtor-certification/model/schema/index.ts create mode 100644 src/features/realtor-certification/model/schema/realtor-certification.schema.ts diff --git a/src/features/realtor-certification/model/index.ts b/src/features/realtor-certification/model/index.ts new file mode 100644 index 0000000..e27a6e2 --- /dev/null +++ b/src/features/realtor-certification/model/index.ts @@ -0,0 +1 @@ +export * from './schema'; diff --git a/src/features/realtor-certification/model/schema/index.ts b/src/features/realtor-certification/model/schema/index.ts new file mode 100644 index 0000000..7c2c56a --- /dev/null +++ b/src/features/realtor-certification/model/schema/index.ts @@ -0,0 +1 @@ +export * from './realtor-certification.schema'; diff --git a/src/features/realtor-certification/model/schema/realtor-certification.schema.ts b/src/features/realtor-certification/model/schema/realtor-certification.schema.ts new file mode 100644 index 0000000..6da4dd2 --- /dev/null +++ b/src/features/realtor-certification/model/schema/realtor-certification.schema.ts @@ -0,0 +1,16 @@ +import { z } from 'zod'; + +import { ACCEPTED_FILE_TYPES, MAX_FILE_SIZE_10MB } from '../../constants'; + +export const realtorCertificationSchema = z.object({ + certificateFile: z + .instanceof(File) + .refine((file) => file.size <= MAX_FILE_SIZE_10MB, '파일 크기는 10MB 이하여야 합니다.') + .refine( + (file) => ACCEPTED_FILE_TYPES.includes(file.type), + 'PDF, JPG, PNG, WEBP 파일만 업로드 가능합니다.', + ) + .refine((file) => file.name.trim().length > 0, '파일명이 비어있습니다.'), +}); + +export type RealtorCertificationFormData = z.infer; From a472a816283097b8e61303f3fac0284d975e854f Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:36:49 +0900 Subject: [PATCH 04/11] =?UTF-8?q?feat:=20=EC=9D=B8=EC=A6=9D=EC=84=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=97=85=EB=A1=9C=EB=93=9C=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/features/FileUploadField.tsx | 28 +++++++++++++++++++ .../components/features/index.ts | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/features/realtor-certification/components/features/FileUploadField.tsx create mode 100644 src/features/realtor-certification/components/features/index.ts diff --git a/src/features/realtor-certification/components/features/FileUploadField.tsx b/src/features/realtor-certification/components/features/FileUploadField.tsx new file mode 100644 index 0000000..3a511dc --- /dev/null +++ b/src/features/realtor-certification/components/features/FileUploadField.tsx @@ -0,0 +1,28 @@ +import { useFormContext } from 'react-hook-form'; + +import { FormField, FormItem, FormMessage } from '@/shared'; + +import { type RealtorCertificationFormData } from '../../model'; +import { CustomFileUpload } from '../common'; + +export const FileUploadField = () => { + const form = useFormContext(); + + return ( + ( + + + + + )} + /> + ); +}; diff --git a/src/features/realtor-certification/components/features/index.ts b/src/features/realtor-certification/components/features/index.ts new file mode 100644 index 0000000..b52cf34 --- /dev/null +++ b/src/features/realtor-certification/components/features/index.ts @@ -0,0 +1 @@ +export * from './FileUploadField'; From b28454cf0101b5014f829ced53ff1d3a2a6e5526 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:37:17 +0900 Subject: [PATCH 05/11] =?UTF-8?q?feat:=20=EB=B6=80=EB=8F=99=EC=82=B0=20?= =?UTF-8?q?=EC=9D=B8=EC=A6=9D=EC=84=9C=20=EC=A0=9C=EC=B6=9C=20=ED=8F=BC=20?= =?UTF-8?q?=EB=B0=8F=20=EC=84=B1=EA=B3=B5=20=EC=84=B9=EC=85=98=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/CertificationForm.tsx | 65 +++++++++++++++++++ .../realtor-certification/ui/index.ts | 3 + 2 files changed, 68 insertions(+) create mode 100644 src/features/realtor-certification/ui/CertificationForm.tsx create mode 100644 src/features/realtor-certification/ui/index.ts diff --git a/src/features/realtor-certification/ui/CertificationForm.tsx b/src/features/realtor-certification/ui/CertificationForm.tsx new file mode 100644 index 0000000..591863a --- /dev/null +++ b/src/features/realtor-certification/ui/CertificationForm.tsx @@ -0,0 +1,65 @@ +import { useState } from 'react'; +import { useForm } from 'react-hook-form'; + +import { zodResolver } from '@hookform/resolvers/zod'; + +import { Button, Form } from '@/shared'; + +import { FileUploadField } from '../components'; +import { type RealtorCertificationFormData, realtorCertificationSchema } from '../model'; + +import { SubmitSuccessSection } from './SubmitSuccessSection'; + +type props = { + onSuccess?: () => void; +}; + +export const CertificationForm = ({ onSuccess }: props) => { + const [isSubmitted, setIsSubmitted] = useState(false); + + const form = useForm({ + resolver: zodResolver(realtorCertificationSchema), + defaultValues: { + certificateFile: undefined, + }, + }); + + const onSubmit = async (data: RealtorCertificationFormData) => { + try { + // TODO: API 호출 로직 구현 + console.log('제출할 데이터:', data); + + // API 호출 시뮬레이션 + await new Promise((resolve) => setTimeout(resolve, 1000)); + + // 제출 성공 시 상태 변경 + setIsSubmitted(true); + onSuccess?.(); + } catch (error) { + console.error('제출 실패:', error); + // TODO: 에러 처리 로직 + } + }; + + if (isSubmitted) { + return ; + } + + return ( +
+ e.preventDefault()}> +
+ + +
+
+ + ); +}; diff --git a/src/features/realtor-certification/ui/index.ts b/src/features/realtor-certification/ui/index.ts new file mode 100644 index 0000000..ee3264e --- /dev/null +++ b/src/features/realtor-certification/ui/index.ts @@ -0,0 +1,3 @@ +export * from './CertificationForm'; +export * from './TitleSection'; +export * from './SubmitSuccessSection'; From d263898892cda050273b555374c85c382f9e0fa1 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:37:27 +0900 Subject: [PATCH 06/11] =?UTF-8?q?feat:=20=EA=B3=B5=EC=9D=B8=EC=A4=91?= =?UTF-8?q?=EA=B0=9C=EC=82=AC=20=EC=9D=B8=EC=A6=9D=EC=84=9C=20=EC=A0=9C?= =?UTF-8?q?=EC=B6=9C=20=EC=84=B1=EA=B3=B5=20=EC=84=B9=EC=85=98=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/SubmitSuccessSection.tsx | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/features/realtor-certification/ui/SubmitSuccessSection.tsx diff --git a/src/features/realtor-certification/ui/SubmitSuccessSection.tsx b/src/features/realtor-certification/ui/SubmitSuccessSection.tsx new file mode 100644 index 0000000..0abc378 --- /dev/null +++ b/src/features/realtor-certification/ui/SubmitSuccessSection.tsx @@ -0,0 +1,20 @@ +import { useNavigate } from 'react-router-dom'; + +import { Button, ROUTER_PATH } from '@/shared'; + +export const SubmitSuccessSection = () => { + const navigate = useNavigate(); + + return ( +
+
+

공인중개사 인증서가 제출되었습니다!

+

빠른 내부 심사 후 중개사 자격을 드릴게요!

+
+ + +
+ ); +}; From 94d70c5d4c284cecac46b658a41f99f71f75785f Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:37:36 +0900 Subject: [PATCH 07/11] =?UTF-8?q?feat:=20=EA=B3=B5=EC=9D=B8=EC=A4=91?= =?UTF-8?q?=EA=B0=9C=EC=82=AC=20=EC=9D=B8=EC=A6=9D=20=EC=84=B9=EC=85=98=20?= =?UTF-8?q?=EC=A0=9C=EB=AA=A9=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/realtor-certification/ui/TitleSection.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/features/realtor-certification/ui/TitleSection.tsx diff --git a/src/features/realtor-certification/ui/TitleSection.tsx b/src/features/realtor-certification/ui/TitleSection.tsx new file mode 100644 index 0000000..fe9b8a8 --- /dev/null +++ b/src/features/realtor-certification/ui/TitleSection.tsx @@ -0,0 +1,8 @@ +export const TitleSection = () => { + return ( +

+ 공인중개사 인증하고 + 간편하고 투명하게 계약해요! +

+ ); +}; From 12a210475fd9858426f348cc028148b816eb1ea1 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:37:47 +0900 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20=EA=B3=B5=EC=9D=B8=EC=A4=91?= =?UTF-8?q?=EA=B0=9C=EC=82=AC=20=EC=9D=B8=EC=A6=9D=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=20=EC=A0=9C=EC=B6=9C=20=EC=83=81=ED=83=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EB=B0=8F=20=EC=BB=B4=ED=8F=AC=EB=84=8C?= =?UTF-8?q?=ED=8A=B8=20=EA=B5=AC=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RealtorCertificationPage.tsx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/pages/realtor/certification/RealtorCertificationPage.tsx b/src/pages/realtor/certification/RealtorCertificationPage.tsx index 242996d..36379cb 100644 --- a/src/pages/realtor/certification/RealtorCertificationPage.tsx +++ b/src/pages/realtor/certification/RealtorCertificationPage.tsx @@ -1,3 +1,22 @@ +import { useState } from 'react'; + +import { CertificationForm, SubmitSuccessSection, TitleSection } from '@/features'; +import { AuthLogoSection } from '@/shared'; + export default function RealtorCertificationPage() { - return
RealtorCertificationPage
; + const [isSubmitted, setIsSubmitted] = useState(false); + + return ( +
+
+ + {!isSubmitted && } + {isSubmitted ? ( + + ) : ( + setIsSubmitted(true)} /> + )} +
+
+ ); } From 7a26cecf700d0c578de8f6779a47bc67a7b76e37 Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:50:55 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=EA=B3=B5=EC=9D=B8=EC=A4=91?= =?UTF-8?q?=EA=B0=9C=EC=82=AC=20=EC=9D=B8=EC=A6=9D=20=ED=8F=BC=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=A0=9C=EC=B6=9C=20=EC=83=81=ED=83=9C=20=EA=B4=80?= =?UTF-8?q?=EB=A6=AC=20=EB=B0=8F=20=EC=84=B1=EA=B3=B5=20=EC=84=B9=EC=85=98?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../realtor-certification/ui/CertificationForm.tsx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/features/realtor-certification/ui/CertificationForm.tsx b/src/features/realtor-certification/ui/CertificationForm.tsx index 591863a..44984c2 100644 --- a/src/features/realtor-certification/ui/CertificationForm.tsx +++ b/src/features/realtor-certification/ui/CertificationForm.tsx @@ -1,4 +1,3 @@ -import { useState } from 'react'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; @@ -8,15 +7,11 @@ import { Button, Form } from '@/shared'; import { FileUploadField } from '../components'; import { type RealtorCertificationFormData, realtorCertificationSchema } from '../model'; -import { SubmitSuccessSection } from './SubmitSuccessSection'; - type props = { onSuccess?: () => void; }; export const CertificationForm = ({ onSuccess }: props) => { - const [isSubmitted, setIsSubmitted] = useState(false); - const form = useForm({ resolver: zodResolver(realtorCertificationSchema), defaultValues: { @@ -33,7 +28,6 @@ export const CertificationForm = ({ onSuccess }: props) => { await new Promise((resolve) => setTimeout(resolve, 1000)); // 제출 성공 시 상태 변경 - setIsSubmitted(true); onSuccess?.(); } catch (error) { console.error('제출 실패:', error); @@ -41,10 +35,6 @@ export const CertificationForm = ({ onSuccess }: props) => { } }; - if (isSubmitted) { - return ; - } - return (
e.preventDefault()}> From c358b932b7779504b27811c6439bd854b95becef Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:51:14 +0900 Subject: [PATCH 10/11] =?UTF-8?q?feat:=20=EC=9D=B8=EC=A6=9D=EC=84=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=97=85=EB=A1=9C=EB=93=9C=20=EC=8B=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/schema/realtor-certification.schema.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/realtor-certification/model/schema/realtor-certification.schema.ts b/src/features/realtor-certification/model/schema/realtor-certification.schema.ts index 6da4dd2..7c82d3a 100644 --- a/src/features/realtor-certification/model/schema/realtor-certification.schema.ts +++ b/src/features/realtor-certification/model/schema/realtor-certification.schema.ts @@ -4,7 +4,7 @@ import { ACCEPTED_FILE_TYPES, MAX_FILE_SIZE_10MB } from '../../constants'; export const realtorCertificationSchema = z.object({ certificateFile: z - .instanceof(File) + .instanceof(File, { message: '인증서 파일을 업로드해주세요.' }) .refine((file) => file.size <= MAX_FILE_SIZE_10MB, '파일 크기는 10MB 이하여야 합니다.') .refine( (file) => ACCEPTED_FILE_TYPES.includes(file.type), From 94a1534a599e1578db91b6799300248456d3332a Mon Sep 17 00:00:00 2001 From: Dobbymin Date: Wed, 20 Aug 2025 02:54:56 +0900 Subject: [PATCH 11/11] =?UTF-8?q?remove:=20=ED=91=B8=ED=84=B0=20=EA=B4=80?= =?UTF-8?q?=EB=A0=A8=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B0=8F=20?= =?UTF-8?q?=ED=83=80=EC=9E=85=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/features/footer/AuthFooter.tsx | 7 ------ .../components/features/footer/index.ts | 1 - .../components/features/layout/Footer.tsx | 22 ------------------- .../components/features/layout/index.ts | 1 - src/shared/types/layout.type.ts | 5 ----- src/widgets/layout/Layout.tsx | 9 +------- 6 files changed, 1 insertion(+), 44 deletions(-) delete mode 100644 src/shared/components/features/footer/AuthFooter.tsx delete mode 100644 src/shared/components/features/footer/index.ts delete mode 100644 src/shared/components/features/layout/Footer.tsx diff --git a/src/shared/components/features/footer/AuthFooter.tsx b/src/shared/components/features/footer/AuthFooter.tsx deleted file mode 100644 index cdeb1d8..0000000 --- a/src/shared/components/features/footer/AuthFooter.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export const AuthFooter = () => { - return ( -
- Footer -
- ); -}; diff --git a/src/shared/components/features/footer/index.ts b/src/shared/components/features/footer/index.ts deleted file mode 100644 index fd67ded..0000000 --- a/src/shared/components/features/footer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './AuthFooter'; diff --git a/src/shared/components/features/layout/Footer.tsx b/src/shared/components/features/layout/Footer.tsx deleted file mode 100644 index 199ef7b..0000000 --- a/src/shared/components/features/layout/Footer.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import type { FooterType } from '../../../types'; -import { AuthFooter } from '../footer'; - -type Props = { - type: FooterType; -}; - -type FooterComponentMap = { - Main: null; - Auth: typeof AuthFooter; -}; - -const FOOTER_COMPONENTS: FooterComponentMap = { - Main: null, - Auth: AuthFooter, -} as const; - -export const Footer = ({ type }: Props) => { - const Component = FOOTER_COMPONENTS[type]; - - return Component === null ? null : ; -}; diff --git a/src/shared/components/features/layout/index.ts b/src/shared/components/features/layout/index.ts index 13ce3a8..266dec8 100644 --- a/src/shared/components/features/layout/index.ts +++ b/src/shared/components/features/layout/index.ts @@ -1,2 +1 @@ export * from './Header'; -export * from './Footer'; diff --git a/src/shared/types/layout.type.ts b/src/shared/types/layout.type.ts index 2fccf0a..d3029d2 100644 --- a/src/shared/types/layout.type.ts +++ b/src/shared/types/layout.type.ts @@ -5,8 +5,3 @@ export type LayoutType = { }; export type HeaderType = LayoutType[keyof LayoutType]; -export type FooterType = Exclude; - -export type LayoutToFooterMap = { - [K in keyof LayoutType]: K extends 'Realtor' ? 'Main' : LayoutType[K]; -}; diff --git a/src/widgets/layout/Layout.tsx b/src/widgets/layout/Layout.tsx index 9f6b12b..ae0e0f4 100644 --- a/src/widgets/layout/Layout.tsx +++ b/src/widgets/layout/Layout.tsx @@ -1,17 +1,11 @@ import { Outlet, useMatches } from 'react-router-dom'; -import { Footer, Header, type LayoutToFooterMap, type LayoutType, ScrollToTop } from '@/shared'; +import { Header, type LayoutType, ScrollToTop } from '@/shared'; type PageHandle = { layout?: keyof LayoutType; }; -const layoutToFooterMap: LayoutToFooterMap = { - Main: 'Main', - Auth: 'Auth', - Realtor: 'Main', -} as const; - export const Layout = () => { const matches = useMatches(); @@ -27,7 +21,6 @@ export const Layout = () => { -