From 64b5743d48d0de9151ceee26ecb0b04bbeabd9bd Mon Sep 17 00:00:00 2001 From: gaaahee Date: Thu, 20 Feb 2025 19:24:55 +0900 Subject: [PATCH 1/9] =?UTF-8?q?chore:=20=ED=95=84=EC=9A=94=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/my-page/ApplyStatus.tsx | 4 ---- src/components/my-page/CurrentPeople.tsx | 10 -------- src/pages/my-page/apply/PurchaseList.tsx | 30 +----------------------- 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/components/my-page/ApplyStatus.tsx b/src/components/my-page/ApplyStatus.tsx index d295b7bb..0612474d 100644 --- a/src/components/my-page/ApplyStatus.tsx +++ b/src/components/my-page/ApplyStatus.tsx @@ -22,10 +22,6 @@ export const ApplyStatus = ({ applicationStatus, postType, }: ApplyStatusProps) => { - // const APPLY_RECORDS = [ - // { id: 'drerwr', role: '디자이너', current: 1, total: 4 }, - // ]; - const handleAccept = async (id?: number) => { if (!id) { return; diff --git a/src/components/my-page/CurrentPeople.tsx b/src/components/my-page/CurrentPeople.tsx index 2854bf39..7114c164 100644 --- a/src/components/my-page/CurrentPeople.tsx +++ b/src/components/my-page/CurrentPeople.tsx @@ -13,16 +13,6 @@ interface CurrentPeopleProps { } export const CurrentPeople = ({ currentMembers }: CurrentPeopleProps) => { - // const CURRENT_MEMBERS = [ - // { - // id: 'serqe', - // role: '디자이너', - // current: 1, - // }, - // ]; - { - console.log('해당 요청 과제의 현재 인원 : ', currentMembers); - } return (
현재 인원
diff --git a/src/pages/my-page/apply/PurchaseList.tsx b/src/pages/my-page/apply/PurchaseList.tsx index 2fe5688a..023acf96 100644 --- a/src/pages/my-page/apply/PurchaseList.tsx +++ b/src/pages/my-page/apply/PurchaseList.tsx @@ -13,34 +13,6 @@ export const PurchaseList = () => { labelText: '기업', labelType: 'corporate', }; - // const PURCHASE_DATA = [ - // { - // id: 1, - // status: '구매 완료', - // statusType: 'purchaseCompleted', - // date: '2024/12/24', - // seller: 'SEO YEON', - // tab: '아이디어 마켓', - // category: '디자인', - // itemName: '디자인 해드립니다', - // price: 200000, - // payment: '카카오페이', - // fee: 500, - // }, - // { - // id: 2, - // status: '구매 완료', - // statusType: 'purchaseCompleted', - // date: '2024/12/24', - // seller: 'SEO YEON', - // tab: '아이디어 마켓', - // category: '디자인', - // itemName: '디자인 해드립니다', - // price: 200000, - // payment: '카카오페이', - // fee: 500, - // }, - // ]; const { data: purchases = [], @@ -80,7 +52,7 @@ export const PurchaseList = () => { /> From 1b296b71e7b23c562b887a5bff189c8f8c7ecad8 Mon Sep 17 00:00:00 2001 From: gaaahee Date: Thu, 20 Feb 2025 19:26:09 +0900 Subject: [PATCH 2/9] =?UTF-8?q?refactor:=20=EA=B2=8C=EC=8B=9C=EA=B8=80=20?= =?UTF-8?q?=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EC=98=81=EC=96=B4->?= =?UTF-8?q?=ED=95=9C=EA=B8=80=20=EB=A7=A4=ED=95=91=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/supportsAPI.ts | 6 ++++++ src/components/my-page/IdeaMarketPostHeader.tsx | 9 ++++++--- src/components/my-page/PostHeader.tsx | 8 +++++--- src/components/my-page/apply/ApplyDetailsInfo.tsx | 11 +++++++---- src/components/my-page/apply/PurchaseDetailsInfo.tsx | 8 +++++--- src/pages/my-page/apply/ApplyCollaboration.tsx | 4 ++-- .../my-page/postsCollaboration/PostsCollaboration.tsx | 2 +- src/pages/my-page/postsIdeaMarket/PostsIdeaMarket.tsx | 2 +- .../my-page/postsRequestAssign/PostsRequestAssign.tsx | 2 +- 9 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/apis/supportsAPI.ts b/src/apis/supportsAPI.ts index 2fb65147..31ab73f5 100644 --- a/src/apis/supportsAPI.ts +++ b/src/apis/supportsAPI.ts @@ -19,6 +19,8 @@ export const getPurchases = async ( params: { page, size }, }); + console.log(response.data?.data?.content); + return response.data?.data?.content ?? []; } catch { throw Error; @@ -40,6 +42,8 @@ export const getAcceptedRequestTasks = async ( params: { page, size }, }); + console.log(response.data?.data?.content); + return response.data?.data?.content ?? []; } catch { throw Error; @@ -61,6 +65,8 @@ export const getRejectedRequestTasks = async ( params: { page, size }, }); + console.log(response.data?.data?.content); + return response.data?.data?.content ?? []; } catch { throw Error; diff --git a/src/components/my-page/IdeaMarketPostHeader.tsx b/src/components/my-page/IdeaMarketPostHeader.tsx index 28b8423e..3834d5d6 100644 --- a/src/components/my-page/IdeaMarketPostHeader.tsx +++ b/src/components/my-page/IdeaMarketPostHeader.tsx @@ -1,9 +1,10 @@ import { useNavigate } from 'react-router-dom'; import styles from './ideaMarketPostHeader.module.scss'; +import { getCategoryLabel } from '../../utils/categoryMapping'; interface PostHeaderProps { tab: string; - category: string; + specialization: string; title: string; price: number; ideaId: number; @@ -11,7 +12,7 @@ interface PostHeaderProps { export const IdeaMarketPostHeader = ({ tab, - category, + specialization, title, price, ideaId, @@ -19,6 +20,8 @@ export const IdeaMarketPostHeader = ({ const navigate = useNavigate(); const FORMATTEDPRICE = price.toLocaleString(); + const FORMATTED_SPECIALIZATION = getCategoryLabel(specialization); + const handleEditNavigate = () => { if (ideaId) { navigate(`/my/posts/idea-market/registered/${ideaId}`); @@ -37,7 +40,7 @@ export const IdeaMarketPostHeader = ({
- {tab} > {category} + {tab} > {FORMATTED_SPECIALIZATION}
{title}
{FORMATTEDPRICE} 원
diff --git a/src/components/my-page/PostHeader.tsx b/src/components/my-page/PostHeader.tsx index 37d10754..eb994607 100644 --- a/src/components/my-page/PostHeader.tsx +++ b/src/components/my-page/PostHeader.tsx @@ -2,10 +2,11 @@ import { useNavigate } from 'react-router-dom'; import styles from './postHeader.module.scss'; import { DeadlineLabel } from '../common/label/DeadlineLabel'; import { calculateDday } from '../../utils/dateUtils'; +import { getCategoryLabel } from '../../utils/categoryMapping.ts'; interface PostHeaderProps { tab: string; - category: string; + specialization: string; title: string; deadline?: string; postImage?: string | null; @@ -14,7 +15,7 @@ interface PostHeaderProps { export const PostHeader = ({ tab, - category, + specialization, title, deadline, postImage, @@ -22,6 +23,7 @@ export const PostHeader = ({ }: PostHeaderProps) => { const navigate = useNavigate(); const dDay = deadline ? calculateDday(deadline) : undefined; + const FORMATTED_SPECIALIZATION = getCategoryLabel(specialization); const handleEditNavigate = () => { let editPath = '/'; @@ -52,7 +54,7 @@ export const PostHeader = ({ )}
- {tab} {'>'} {category} + {tab} {'>'} {FORMATTED_SPECIALIZATION}

{title}

{dDay !== undefined && } diff --git a/src/components/my-page/apply/ApplyDetailsInfo.tsx b/src/components/my-page/apply/ApplyDetailsInfo.tsx index 4b8ca39d..af748a06 100644 --- a/src/components/my-page/apply/ApplyDetailsInfo.tsx +++ b/src/components/my-page/apply/ApplyDetailsInfo.tsx @@ -1,33 +1,36 @@ import styles from './itemDetailsInfo.module.scss'; import arrowItemDetailsButtonIcon from '../../../assets/icons/arrowButton.svg'; import { Image } from '../../common/image/Image'; +import { getCategoryLabel } from '../../../utils/categoryMapping'; interface ApplyDetailsInfoProps { tab: string; - category: string; + specialization: string; itemName: string; part: string; } export const ApplyDetailsInfo = ({ tab, - category, + specialization, itemName, part, }: ApplyDetailsInfoProps) => { + const FORMMATED_SPECIALIZATION = getCategoryLabel(specialization); + const FORMMATED_PART = getCategoryLabel(part); return ( <>
- {tab} > {category} + {tab} > {FORMMATED_SPECIALIZATION}
{itemName}
지원파트 - {part} + {FORMMATED_PART}
+
diff --git a/src/components/my-page/apply/ApplyDetailsInfo.tsx b/src/components/my-page/apply/ApplyDetailsInfo.tsx index af748a06..40c67ca4 100644 --- a/src/components/my-page/apply/ApplyDetailsInfo.tsx +++ b/src/components/my-page/apply/ApplyDetailsInfo.tsx @@ -1,9 +1,11 @@ +import { useNavigate } from 'react-router-dom'; import styles from './itemDetailsInfo.module.scss'; import arrowItemDetailsButtonIcon from '../../../assets/icons/arrowButton.svg'; import { Image } from '../../common/image/Image'; import { getCategoryLabel } from '../../../utils/categoryMapping'; interface ApplyDetailsInfoProps { + postId: number; tab: string; specialization: string; itemName: string; @@ -11,13 +13,22 @@ interface ApplyDetailsInfoProps { } export const ApplyDetailsInfo = ({ + postId, tab, specialization, itemName, part, }: ApplyDetailsInfoProps) => { + const navigate = useNavigate(); + const handleNavigate = () => { + if (tab === '요청 과제') navigate(`/request-assign/registerd/${postId}`); + if (tab === '협업 광장') + navigate(`/collaboration/postdetailwithlink/${postId}`); + }; + const FORMMATED_SPECIALIZATION = getCategoryLabel(specialization); const FORMMATED_PART = getCategoryLabel(part); + return ( <>
@@ -33,7 +44,9 @@ export const ApplyDetailsInfo = ({ {FORMMATED_PART}
-
diff --git a/src/pages/my-page/apply/PurchaseList.tsx b/src/pages/my-page/apply/PurchaseList.tsx index 023acf96..bdc84a3c 100644 --- a/src/pages/my-page/apply/PurchaseList.tsx +++ b/src/pages/my-page/apply/PurchaseList.tsx @@ -9,7 +9,6 @@ import { PayInfo } from '../../../components/my-page/apply/PayInfo'; export const PurchaseList = () => { const FORM_DATA = { - cardTitle: '구매 상세 내역', labelText: '기업', labelType: 'corporate', }; @@ -42,7 +41,7 @@ export const PurchaseList = () => { date={purchase.purchasedAt} status='구매 완료' statusType='purchaseCompleted' - cardTitle={FORM_DATA.cardTitle} + cardTitle={'구매 상세 내역'} />
{ labelType={FORM_DATA.labelType} /> Date: Thu, 20 Feb 2025 22:24:10 +0900 Subject: [PATCH 5/9] =?UTF-8?q?refactor:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A7=80=EC=9B=90=ED=98=84=ED=99=A9=20-?= =?UTF-8?q?=20=EA=B5=AC=EB=A7=A4=EB=82=B4=EC=97=AD=20=EC=88=98=EB=9F=89=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../my-page/apply/PurchaseDetailsInfo.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/components/my-page/apply/PurchaseDetailsInfo.tsx b/src/components/my-page/apply/PurchaseDetailsInfo.tsx index c3d8ab37..f92e47ac 100644 --- a/src/components/my-page/apply/PurchaseDetailsInfo.tsx +++ b/src/components/my-page/apply/PurchaseDetailsInfo.tsx @@ -1,22 +1,34 @@ +import { useNavigate } from 'react-router-dom'; import styles from './itemDetailsInfo.module.scss'; import arrowItemDetailsButtonIcon from '../../../assets/icons/arrowButton.svg'; import { Image } from '../../common/image/Image'; import { getCategoryLabel } from '../../../utils/categoryMapping'; interface PurchaseDetailsInfoProps { + ideaId: number; tab: string; specialization: string; itemName: string; price: number; + quantity: number; } export const PurchaseDetailsInfo = ({ + ideaId, tab, specialization, itemName, price, + quantity, }: PurchaseDetailsInfoProps) => { const FORMATTED_SPECIALIZATION = getCategoryLabel(specialization); + + const navigate = useNavigate(); + const handleNavigate = () => { + console.log('ideaId', ideaId); + navigate(`/idea-market/registerd/${ideaId}`); + }; + return ( <>
@@ -26,14 +38,16 @@ export const PurchaseDetailsInfo = ({ {tab} > {FORMATTED_SPECIALIZATION}
{itemName}
-
{price.toLocaleString()}
+
{price.toLocaleString()} 원
수량 - 1개 + {quantity}개
-
- + 화살표 + + {isMessageModalOpen && ( + + )}
From e8f269ee4fef162a836e04fd1d0d18ed2e6e17ce Mon Sep 17 00:00:00 2001 From: gaaahee Date: Thu, 20 Feb 2025 23:03:16 +0900 Subject: [PATCH 7/9] =?UTF-8?q?fix:=20props=EB=A1=9C=20=EC=9D=B8=ED=95=9C?= =?UTF-8?q?=20=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/my-page/CurrentPeople.tsx | 6 ++++-- src/types/postDataType.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/my-page/CurrentPeople.tsx b/src/components/my-page/CurrentPeople.tsx index e4536062..4bcbb360 100644 --- a/src/components/my-page/CurrentPeople.tsx +++ b/src/components/my-page/CurrentPeople.tsx @@ -8,7 +8,7 @@ interface CurrentPeopleProps { memberId: { id: string; userType: string; - userId: number; + acceptedMemberId: number; }[]; }[]; } @@ -47,7 +47,9 @@ export const CurrentPeople = ({ currentMembers }: CurrentPeopleProps) => {
diff --git a/src/types/postDataType.ts b/src/types/postDataType.ts index b8ac5824..3983dfdb 100644 --- a/src/types/postDataType.ts +++ b/src/types/postDataType.ts @@ -79,6 +79,7 @@ export interface RequestTaskDetail extends RequestTask { memberId: { id: string; userType: string; + acceptedMemberId: number; }[]; }[]; } From 6515a4243f902dfab6f04054b7e6df5e2b055a49 Mon Sep 17 00:00:00 2001 From: gaaahee Date: Fri, 21 Feb 2025 11:14:36 +0900 Subject: [PATCH 8/9] =?UTF-8?q?fix:=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/my-page/apply/ApplyDetailsInfo.tsx | 2 +- src/components/my-page/apply/PurchaseDetailsInfo.tsx | 2 +- src/constants/categoryMapper.ts | 5 +++++ src/pages/my-page/apply/PurchaseList.tsx | 9 ++------- src/utils/categoryMapping.ts | 5 +++++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/my-page/apply/ApplyDetailsInfo.tsx b/src/components/my-page/apply/ApplyDetailsInfo.tsx index 40c67ca4..79b49257 100644 --- a/src/components/my-page/apply/ApplyDetailsInfo.tsx +++ b/src/components/my-page/apply/ApplyDetailsInfo.tsx @@ -21,7 +21,7 @@ export const ApplyDetailsInfo = ({ }: ApplyDetailsInfoProps) => { const navigate = useNavigate(); const handleNavigate = () => { - if (tab === '요청 과제') navigate(`/request-assign/registerd/${postId}`); + if (tab === '요청 과제') navigate(`/request-assign/registered/${postId}`); if (tab === '협업 광장') navigate(`/collaboration/postdetailwithlink/${postId}`); }; diff --git a/src/components/my-page/apply/PurchaseDetailsInfo.tsx b/src/components/my-page/apply/PurchaseDetailsInfo.tsx index f92e47ac..a939116c 100644 --- a/src/components/my-page/apply/PurchaseDetailsInfo.tsx +++ b/src/components/my-page/apply/PurchaseDetailsInfo.tsx @@ -26,7 +26,7 @@ export const PurchaseDetailsInfo = ({ const navigate = useNavigate(); const handleNavigate = () => { console.log('ideaId', ideaId); - navigate(`/idea-market/registerd/${ideaId}`); + navigate(`/idea-market/registered/${ideaId}`); }; return ( diff --git a/src/constants/categoryMapper.ts b/src/constants/categoryMapper.ts index 30fe31ce..8c40e846 100644 --- a/src/constants/categoryMapper.ts +++ b/src/constants/categoryMapper.ts @@ -75,3 +75,8 @@ export const SKILL_PROFICIENCY_MAPPER_TO_ENG: Record = { 중: 'MEDIUM', 하: 'LOW', }; + +export const LABEL_TYPE_MAPPER: Record = { + INDIVIDUAL: '개인', + COMPANY: '기업', +}; diff --git a/src/pages/my-page/apply/PurchaseList.tsx b/src/pages/my-page/apply/PurchaseList.tsx index 1de3b083..170f60b1 100644 --- a/src/pages/my-page/apply/PurchaseList.tsx +++ b/src/pages/my-page/apply/PurchaseList.tsx @@ -10,11 +10,6 @@ import LoadingPage from '../../loading/LoadingPage'; import { ErrorPage } from '../../errorPage/ErrorPage'; export const PurchaseList = () => { - const FORM_DATA = { - labelText: '기업', - labelType: 'corporate', - }; - const { data: purchases = [], isLoading, @@ -48,8 +43,8 @@ export const PurchaseList = () => {
{ @@ -15,3 +16,7 @@ export const getTaskTypeLabel = (taskTypeKey: string): string => { export const getPaymentDurationLabel = (paymentKey: string): string => { return PAYMENT_DURATION_LABELS[paymentKey] || '추후 협의'; }; + +export const getLabelType = (labelType: string): string => { + return LABEL_TYPE_MAPPER[labelType] ?? '개인'; +}; From f318aab24466e63a6039c90fb6ebb109062c2e77 Mon Sep 17 00:00:00 2001 From: gaaahee Date: Fri, 21 Feb 2025 11:23:09 +0900 Subject: [PATCH 9/9] =?UTF-8?q?fix:=20=EC=97=90=EB=9F=AC=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/my-page/CurrentPeople.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/my-page/CurrentPeople.tsx b/src/components/my-page/CurrentPeople.tsx index 4bcbb360..c42412ee 100644 --- a/src/components/my-page/CurrentPeople.tsx +++ b/src/components/my-page/CurrentPeople.tsx @@ -8,7 +8,7 @@ interface CurrentPeopleProps { memberId: { id: string; userType: string; - acceptedMemberId: number; + acceptedMemberId?: number; }[]; }[]; } @@ -48,7 +48,7 @@ export const CurrentPeople = ({ currentMembers }: CurrentPeopleProps) => {