From beae965d5310568ba081f5256da771c9ea4fa207 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:28:43 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=E2=9C=A8=20chore=208.1=20api=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=20=ED=83=80=EC=9E=85=20=EC=A0=95=EC=9D=98=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/api/document.ts | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/types/api/document.ts diff --git a/src/types/api/document.ts b/src/types/api/document.ts new file mode 100644 index 00000000..686b4cac --- /dev/null +++ b/src/types/api/document.ts @@ -0,0 +1,49 @@ +export type DocumentStatus = + | 'TEMPORARY_SAVE' + | 'SUBMITTED' + | 'BEFORE_CONFIRMATION' + | 'REQUEST' + | 'CONFIRMATION'; + +export type DocumentInfo = { + id: number; + pdf_url?: string; + hwp_url?: string; + word_url?: string; + status?: DocumentStatus; +}; + +export type IntegratedApplicationInfo = { + id: number; + pdf_url?: string; + hwp_url?: string; + word_url?: string; +}; + +export type DocumentsSummaryResponse = { + part_time_employment_permits?: DocumentInfo; + standard_labor_contract?: DocumentInfo; + integrated_application?: DocumentInfo; +}; + +export enum DocumentType { + PART_TIME_PERMIT = 'part_time_employment_permits', + LABOR_CONTRACT = 'standard_labor_contract', + INTEGRATED_APPLICATION = 'integrated_application', +} + +// 문서 타입별 정보를 담은 객체 +export const DocumentTypeInfo = { + [DocumentType.PART_TIME_PERMIT]: { + name: 'Part-Time Work Permit Form', + key: 'part_time_employment_permits', + }, + [DocumentType.LABOR_CONTRACT]: { + name: 'Employment Contract', + key: 'standard_labor_contract', + }, + [DocumentType.INTEGRATED_APPLICATION]: { + name: 'Integrated Application Form', + key: 'integrated_application', + }, +} as const; From 77b0bfc4e655b3533b156f3aff81dc98a989229d Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:29:37 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=84=9C=EB=A5=98=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EB=A0=88=EC=9D=B4=EC=95=84=EC=9B=83=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationDocumentsPage.tsx | 53 +++++++++++++++++++ src/router.tsx | 5 ++ 2 files changed, 58 insertions(+) create mode 100644 src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx diff --git a/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx new file mode 100644 index 00000000..bd12b735 --- /dev/null +++ b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx @@ -0,0 +1,53 @@ +import BottomButtonPanel from '@/components/Common/BottomButtonPanel'; +import Button from '@/components/Common/Button'; +import BaseHeader from '@/components/Common/Header/BaseHeader'; +import DocumentCardList from '@/components/Document/DocumentCardList'; +import { DocumentsSummaryResponse } from '@/types/api/document'; + +const mockDocumentsSummaryResponse: DocumentsSummaryResponse = { + part_time_employment_permits: { + id: 1001, + pdf_url: "https://example.com/permits/part_time_1001.pdf", + hwp_url: "https://example.com/permits/part_time_1001.hwp", + word_url: "https://example.com/permits/part_time_1001.docx", + status: "SUBMITTED" + }, + standard_labor_contract: { + id: 2001, + pdf_url: "https://example.com/contracts/standard_2001.pdf", + hwp_url: "https://example.com/contracts/standard_2001.hwp", + word_url: "https://example.com/contracts/standard_2001.docx", + status: "CONFIRMATION" + }, + +}; + +const ApplicationDocumentsPage = () => { + {/*integrated_application: { + id: 3001, + pdf_url: "https://example.com/applications/integrated_3001.pdf", + hwp_url: "https://example.com/applications/integrated_3001.hwp", + word_url: "https://example.com/applications/integrated_3001.docx" + }*/} + return ( +
+ + + +
+ ); +}; + +export default ApplicationDocumentsPage; diff --git a/src/router.tsx b/src/router.tsx index 6e04d111..833e7d03 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -1,6 +1,7 @@ import { BrowserRouter, Route, Routes } from 'react-router-dom'; import HomePage from '@/pages/Home/HomePage'; import InformationPage from './pages/Information/InformationPage'; +import ApplicationDocumentsPage from './pages/ApplicationDocuments/ApplicationDocumentsPage'; const Router = () => { return ( @@ -8,6 +9,10 @@ const Router = () => { } /> } /> + } + /> ); From 4efec906d8c7e26a03bb0f15b0b7b80787d2f017 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:30:26 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E2=9C=A8=20feat:=20=EB=AC=B8=EC=84=9C?= =?UTF-8?q?=EA=B0=80=20=EC=97=86=EC=9D=84=20=EB=95=8C=20=EB=82=98=EC=98=A4?= =?UTF-8?q?=EB=8A=94=20=EA=B8=B0=EB=B3=B8=20=EB=B2=84=ED=8A=BC=20=EB=B0=8F?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EB=A1=9C=EC=A7=81=20=EC=9E=91=EC=84=B1=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/AddButton.svg | 7 +++ src/components/Document/DocumentCardList.tsx | 47 ++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/assets/icons/AddButton.svg create mode 100644 src/components/Document/DocumentCardList.tsx diff --git a/src/assets/icons/AddButton.svg b/src/assets/icons/AddButton.svg new file mode 100644 index 00000000..ef1235f3 --- /dev/null +++ b/src/assets/icons/AddButton.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/Document/DocumentCardList.tsx b/src/components/Document/DocumentCardList.tsx new file mode 100644 index 00000000..a305906e --- /dev/null +++ b/src/components/Document/DocumentCardList.tsx @@ -0,0 +1,47 @@ +import { + DocumentsSummaryResponse, + DocumentType, + DocumentTypeInfo, +} from '@/types/api/document'; +import DocumentCard from './DocumentCard'; +import AddIcon from '@/assets/icons/AddButton.svg?react'; +import { useNavigate } from 'react-router-dom'; + +const DocumentCardList = ({ + documents, +}: { + documents: DocumentsSummaryResponse; +}) => { + const navigate = useNavigate(); + const documentTypes = Object.values(DocumentType); + const MakeDocumentButton = ({ title }: { title: string }) => { + return ( +
+
+
+
+
{title}
+
+
navigate('/write/application-form')}> + +
+
+
+
+ ); + }; + + return ( +
+ {documentTypes.map((property) => + documents[property] ? ( + + ) : ( + + ), + )} +
+ ); +}; + +export default DocumentCardList; From 7c32b813ee6539af9794d444b0f9f391654ae623 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:17:21 +0900 Subject: [PATCH 4/9] =?UTF-8?q?:sparkles:=20feat:=20=EB=AC=B8=EC=84=9C=20?= =?UTF-8?q?=EC=83=81=ED=99=A9=EB=B3=84=20=EC=B9=B4=EB=93=9C=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=9E=91=EC=84=B1=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/CheckIconGreen.svg | 5 + src/assets/icons/DownloadIcon.svg | 7 + src/assets/icons/FolderIcon.svg | 5 + src/assets/icons/TalkBalloon.svg | 8 + src/assets/icons/TalkBalloonGrey.svg | 8 + src/assets/icons/WriteIcon.svg | 7 + src/components/Document/DocumentCard.tsx | 367 +++++++++++++++++++++++ 7 files changed, 407 insertions(+) create mode 100644 src/assets/icons/CheckIconGreen.svg create mode 100644 src/assets/icons/DownloadIcon.svg create mode 100644 src/assets/icons/FolderIcon.svg create mode 100644 src/assets/icons/TalkBalloon.svg create mode 100644 src/assets/icons/TalkBalloonGrey.svg create mode 100644 src/assets/icons/WriteIcon.svg create mode 100644 src/components/Document/DocumentCard.tsx diff --git a/src/assets/icons/CheckIconGreen.svg b/src/assets/icons/CheckIconGreen.svg new file mode 100644 index 00000000..06aafcf9 --- /dev/null +++ b/src/assets/icons/CheckIconGreen.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/icons/DownloadIcon.svg b/src/assets/icons/DownloadIcon.svg new file mode 100644 index 00000000..1a1de5a9 --- /dev/null +++ b/src/assets/icons/DownloadIcon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/icons/FolderIcon.svg b/src/assets/icons/FolderIcon.svg new file mode 100644 index 00000000..4d64b10f --- /dev/null +++ b/src/assets/icons/FolderIcon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/src/assets/icons/TalkBalloon.svg b/src/assets/icons/TalkBalloon.svg new file mode 100644 index 00000000..cdb39de4 --- /dev/null +++ b/src/assets/icons/TalkBalloon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icons/TalkBalloonGrey.svg b/src/assets/icons/TalkBalloonGrey.svg new file mode 100644 index 00000000..697ffc5a --- /dev/null +++ b/src/assets/icons/TalkBalloonGrey.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/assets/icons/WriteIcon.svg b/src/assets/icons/WriteIcon.svg new file mode 100644 index 00000000..25515621 --- /dev/null +++ b/src/assets/icons/WriteIcon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/Document/DocumentCard.tsx b/src/components/Document/DocumentCard.tsx new file mode 100644 index 00000000..5ccd4bd7 --- /dev/null +++ b/src/components/Document/DocumentCard.tsx @@ -0,0 +1,367 @@ +import { DocumentInfo } from '@/types/api/document'; +import Button from '@/components/Common/Button'; +import ArrowrightIcon from '@/assets/icons/Chevron.svg?react'; +import TalkBallonIcon from '@/assets/icons/TalkBalloon.svg?react'; +import TalkBallonIconGrey from '@/assets/icons/TalkBalloonGrey.svg?react'; +import FolderIcon from '@/assets/icons/FolderIcon.svg?react'; +import DownloadIcon from '@/assets/icons/DownloadIcon.svg?react'; +import CheckIconGreen from '@/assets/icons/CheckIconGreen.svg?react'; +import WriteIcon from '@/assets/icons/WriteIcon.svg?react'; + +const enum DocumentStatus { + TEMPORARY_SAVE = 'TEMPORARY_SAVE', + SUBMITTED = 'SUBMITTED', + BEFORE_CONFIRMATION = 'BEFORE_CONFIRMATION', + REQUEST = 'REQUEST', + CONFIRMATION = 'CONFIRMATION', +} + +type DocumentCardProps = { + document: DocumentInfo; + title: string; + onNext: () => void; +}; + +const TemporarySaveCard = ({ + title, + onNext, +}: { + title: string; + onNext: () => void; +}) => { + return ( +
+
+
+ Check my Work Permit Form +
+
+
+
+ +
+
+
+
+
+
{title}
+
+
+ +
+
+ +
+
+

+ You can request the employer to complete the part-time employment + permit form by clicking Submit. After the request is made, editing + will no longer be possible. +

+
 
+

+ * Please carefully review the information to ensure its accuracy. +

+
+
+
+
+
+
+ ); +}; + +const BeforeConfirmationCard = ({ + title, + onNext, +}: { + title: string; + onNext: () => void; +}) => { + return ( +
+
+
+ Check my Work Permit Form +
+
+
+
+ +
+
+
+
+
+
{title}
+
+
+ +
+
+ +
+
+

+ The employer has completed the part-time employment permit form. + Please review the content and if there are any issues, submit a + Request. If everything is fine, complete the process by selecting + Confirm. +

+
 
+

+ * Please note that after confirming, no further edits can be made +

+
+
+
+
+
+
+ ); +}; + +const SubmittedCard = ({ title }: { title: string }) => { + return ( +
+
+
+ Pending ... +
+
+
+
+
+
{title}
+
+
+ +
+
+ +
+
+

+ The employer is in the process of completing the part-time + employment permit form +

+
+
+
+ +
+
+
+
+ +
+
writing ...
+
+
+
+
+ ); +}; + +const RequestedCard = ({ title }: { title: string }) => { + return ( +
+
+
+ Pending ... +
+
+
+
+
+
{title}
+
+
+ +
+
+ +
+
+

+ The employer is revising the document according to the requested + changes. +

+
+
+
+ +
+
+
+
+ +
+
rewriting ...
+
+
+
+
+ ); +}; + +const ConfirmationCard = ({ + document, + title, + onDownload, +}: { + title: string; + document: DocumentInfo; + onDownload: (url: string) => void; +}) => { + return ( +
+
+
+ Your form is ready ! Check it out +
+
+
+
+
+
{title}
+
+
+ {!document.pdf_url && !document.hwp_url && !document.word_url ? ( + + ) : ( + + )} +
+
+ +
+
+

+ The employer is in the process of completing the part-time + employment permit form +

+
+
+
+ +
+ {document.pdf_url && ( +
+
+
+ +
+
+ Pdf file download +
+
+
onDownload(document.pdf_url as string)}> + +
+
+ )} + {document.word_url && ( +
+
+
+ +
+
+ word file download +
+
+
onDownload(document.word_url as string)}> + +
+
+ )} + {document.hwp_url && ( +
+
+
+ +
+
+ smth file download +
+
+
onDownload(document.hwp_url as string)}> + +
+
+ )} +
+
+ ); +}; + +const DocumentCardDispenser = ({ + document, + title, + onNext, +}: DocumentCardProps) => { + const handleDownload = (url: string) => { + window.open(url, '_blank'); + }; + if (title === 'Integrated Application Form') + return ( + + ); + switch (document.status) { + case DocumentStatus.TEMPORARY_SAVE: + return ; + case DocumentStatus.SUBMITTED: + return ; + case DocumentStatus.BEFORE_CONFIRMATION: + return ; + case DocumentStatus.REQUEST: + return ; + case DocumentStatus.CONFIRMATION: + return ( + + ); + } +}; + +export default DocumentCardDispenser; From d953d29858f6e301ad9672b3f7641703f07b0180 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:18:39 +0900 Subject: [PATCH 5/9] =?UTF-8?q?:white=5Fcheck=5Fmark:=20test:=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EA=B4=80=EB=A0=A8=20mockdata=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationDocuments/ApplicationDocumentsPage.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx index bd12b735..710cc45d 100644 --- a/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx +++ b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx @@ -10,16 +10,21 @@ const mockDocumentsSummaryResponse: DocumentsSummaryResponse = { pdf_url: "https://example.com/permits/part_time_1001.pdf", hwp_url: "https://example.com/permits/part_time_1001.hwp", word_url: "https://example.com/permits/part_time_1001.docx", - status: "SUBMITTED" + status: "TEMPORARY_SAVE" }, standard_labor_contract: { id: 2001, pdf_url: "https://example.com/contracts/standard_2001.pdf", hwp_url: "https://example.com/contracts/standard_2001.hwp", word_url: "https://example.com/contracts/standard_2001.docx", - status: "CONFIRMATION" + status: "BEFORE_CONFIRMATION" }, - + integrated_application: { + id: 3001, + pdf_url: "https://example.com/applications/integrated_3001.pdf", + hwp_url: "https://example.com/applications/integrated_3001.hwp", + word_url: "https://example.com/applications/integrated_3001.docx" + } }; const ApplicationDocumentsPage = () => { From e4cf7c40caa3573110a32ccb42047c7a639cec2a Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Tue, 22 Oct 2024 20:19:41 +0900 Subject: [PATCH 6/9] =?UTF-8?q?:sparkles:=20feat:=20dispenser=20=ED=98=95?= =?UTF-8?q?=ED=83=9C=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Document/DocumentCardList.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/Document/DocumentCardList.tsx b/src/components/Document/DocumentCardList.tsx index a305906e..6ef9651f 100644 --- a/src/components/Document/DocumentCardList.tsx +++ b/src/components/Document/DocumentCardList.tsx @@ -3,9 +3,9 @@ import { DocumentType, DocumentTypeInfo, } from '@/types/api/document'; -import DocumentCard from './DocumentCard'; import AddIcon from '@/assets/icons/AddButton.svg?react'; import { useNavigate } from 'react-router-dom'; +import DocumentCardDispenser from './DocumentCard'; const DocumentCardList = ({ documents, @@ -14,6 +14,11 @@ const DocumentCardList = ({ }) => { const navigate = useNavigate(); const documentTypes = Object.values(DocumentType); + const handleOnNext = () => { + //추후 api 작성 시 완성 + alert('onNext'); + }; + const MakeDocumentButton = ({ title }: { title: string }) => { return (
@@ -32,10 +37,14 @@ const DocumentCardList = ({ }; return ( -
+
{documentTypes.map((property) => documents[property] ? ( - + ) : ( ), From c22858c6c6e1fb9af7f32a952867bb1c01731beb Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:15:29 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=F0=9F=94=A7=20chore:=20=EC=A0=88=EB=8C=80?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=20=EC=82=AC=EC=9A=A9,=20constants=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A0=81=ED=95=A9=ED=95=9C=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/documents.ts | 17 +++++++++++++++++ .../ApplicationDocumentsPage.tsx | 6 ------ src/router.tsx | 4 ++-- src/types/api/document.ts | 16 ---------------- 4 files changed, 19 insertions(+), 24 deletions(-) create mode 100644 src/constants/documents.ts diff --git a/src/constants/documents.ts b/src/constants/documents.ts new file mode 100644 index 00000000..b1380ed5 --- /dev/null +++ b/src/constants/documents.ts @@ -0,0 +1,17 @@ +import { DocumentType } from '@/types/api/document'; + +// 문서 타입별 정보를 담은 객체 +export const DocumentTypeInfo = { + [DocumentType.PART_TIME_PERMIT]: { + name: 'Part-Time Work Permit Form', + key: 'part_time_employment_permits', + }, + [DocumentType.LABOR_CONTRACT]: { + name: 'Employment Contract', + key: 'standard_labor_contract', + }, + [DocumentType.INTEGRATED_APPLICATION]: { + name: 'Integrated Application Form', + key: 'integrated_application', + }, +} as const; diff --git a/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx index 710cc45d..bcf4fe90 100644 --- a/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx +++ b/src/pages/ApplicationDocuments/ApplicationDocumentsPage.tsx @@ -19,12 +19,6 @@ const mockDocumentsSummaryResponse: DocumentsSummaryResponse = { word_url: "https://example.com/contracts/standard_2001.docx", status: "BEFORE_CONFIRMATION" }, - integrated_application: { - id: 3001, - pdf_url: "https://example.com/applications/integrated_3001.pdf", - hwp_url: "https://example.com/applications/integrated_3001.hwp", - word_url: "https://example.com/applications/integrated_3001.docx" - } }; const ApplicationDocumentsPage = () => { diff --git a/src/router.tsx b/src/router.tsx index 833e7d03..b22876e4 100644 --- a/src/router.tsx +++ b/src/router.tsx @@ -1,7 +1,7 @@ import { BrowserRouter, Route, Routes } from 'react-router-dom'; import HomePage from '@/pages/Home/HomePage'; -import InformationPage from './pages/Information/InformationPage'; -import ApplicationDocumentsPage from './pages/ApplicationDocuments/ApplicationDocumentsPage'; +import InformationPage from '@/pages/Information/InformationPage'; +import ApplicationDocumentsPage from '@/pages/ApplicationDocuments/ApplicationDocumentsPage'; const Router = () => { return ( diff --git a/src/types/api/document.ts b/src/types/api/document.ts index 686b4cac..aa54965c 100644 --- a/src/types/api/document.ts +++ b/src/types/api/document.ts @@ -31,19 +31,3 @@ export enum DocumentType { LABOR_CONTRACT = 'standard_labor_contract', INTEGRATED_APPLICATION = 'integrated_application', } - -// 문서 타입별 정보를 담은 객체 -export const DocumentTypeInfo = { - [DocumentType.PART_TIME_PERMIT]: { - name: 'Part-Time Work Permit Form', - key: 'part_time_employment_permits', - }, - [DocumentType.LABOR_CONTRACT]: { - name: 'Employment Contract', - key: 'standard_labor_contract', - }, - [DocumentType.INTEGRATED_APPLICATION]: { - name: 'Integrated Application Form', - key: 'integrated_application', - }, -} as const; From eadf8ba10785950ab324ea33bc994d2967a10163 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:17:04 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20MakeDoucme?= =?UTF-8?q?ntButton=20=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Document/DocumentCardList.tsx | 28 ++----------------- .../Document/MakeDocumentButton.tsx | 23 +++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 src/components/Document/MakeDocumentButton.tsx diff --git a/src/components/Document/DocumentCardList.tsx b/src/components/Document/DocumentCardList.tsx index 6ef9651f..8c9e583c 100644 --- a/src/components/Document/DocumentCardList.tsx +++ b/src/components/Document/DocumentCardList.tsx @@ -1,41 +1,19 @@ -import { - DocumentsSummaryResponse, - DocumentType, - DocumentTypeInfo, -} from '@/types/api/document'; -import AddIcon from '@/assets/icons/AddButton.svg?react'; -import { useNavigate } from 'react-router-dom'; +import { DocumentsSummaryResponse, DocumentType } from '@/types/api/document'; import DocumentCardDispenser from './DocumentCard'; +import MakeDocumentButton from './MakeDocumentButton'; +import { DocumentTypeInfo } from '@/constants/documents'; const DocumentCardList = ({ documents, }: { documents: DocumentsSummaryResponse; }) => { - const navigate = useNavigate(); const documentTypes = Object.values(DocumentType); const handleOnNext = () => { //추후 api 작성 시 완성 alert('onNext'); }; - const MakeDocumentButton = ({ title }: { title: string }) => { - return ( -
-
-
-
-
{title}
-
-
navigate('/write/application-form')}> - -
-
-
-
- ); - }; - return (
{documentTypes.map((property) => diff --git a/src/components/Document/MakeDocumentButton.tsx b/src/components/Document/MakeDocumentButton.tsx new file mode 100644 index 00000000..24cf07d9 --- /dev/null +++ b/src/components/Document/MakeDocumentButton.tsx @@ -0,0 +1,23 @@ +import AddIcon from '@/assets/icons/AddButton.svg?react'; +import { useNavigate } from 'react-router-dom'; + +const MakeDocumentButton = ({ title }: { title: string }) => { + const navigate = useNavigate(); + + return ( +
+
+
+
+
{title}
+
+
navigate('/write/application-form')}> + +
+
+
+
+ ); +}; + +export default MakeDocumentButton; From c88a1f209b98497c3b66496c9f2673a1ddba0da4 Mon Sep 17 00:00:00 2001 From: Savien/Woo Jun Han <49388937+MrMirror21@users.noreply.github.com> Date: Wed, 23 Oct 2024 11:17:57 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=F0=9F=90=9B=20fix:=20onClick=20property?= =?UTF-8?q?=EC=97=90=20=EC=98=AC=EB=B0=94=EB=A5=B8=20=ED=95=A8=EC=88=98=20?= =?UTF-8?q?=ED=98=95=ED=83=9C=20=EC=A0=84=EB=8B=AC=20#24?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Document/DocumentCard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Document/DocumentCard.tsx b/src/components/Document/DocumentCard.tsx index 5ccd4bd7..33e992e9 100644 --- a/src/components/Document/DocumentCard.tsx +++ b/src/components/Document/DocumentCard.tsx @@ -72,7 +72,7 @@ const TemporarySaveCard = ({ fontColor="text-[#222]" isBorder={false} title="Edit" - onClick={() => onNext} + onClick={onNext} />
@@ -138,7 +138,7 @@ const BeforeConfirmationCard = ({ fontColor="text-white" isBorder={false} title="Request" - onClick={() => onNext} + onClick={onNext} />