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/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..c42412ee 100644 --- a/src/components/my-page/CurrentPeople.tsx +++ b/src/components/my-page/CurrentPeople.tsx @@ -1,3 +1,4 @@ +import { useNavigate } from 'react-router-dom'; import styles from './applyStatus.module.scss'; interface CurrentPeopleProps { @@ -13,16 +14,11 @@ interface CurrentPeopleProps { } export const CurrentPeople = ({ currentMembers }: CurrentPeopleProps) => { - // const CURRENT_MEMBERS = [ - // { - // id: 'serqe', - // role: '디자이너', - // current: 1, - // }, - // ]; - { - console.log('해당 요청 과제의 현재 인원 : ', currentMembers); - } + const navigate = useNavigate(); + const handleProfile = (userId: number, userType: string) => { + navigate(`/personal-profile/${userId}/${userType}`); + }; + return (
현재 인원
@@ -49,7 +45,13 @@ export const CurrentPeople = ({ currentMembers }: CurrentPeopleProps) => { {member.approvedCount}
- +
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 226a866e..e536ae7b 100644 --- a/src/components/my-page/PostHeader.tsx +++ b/src/components/my-page/PostHeader.tsx @@ -3,10 +3,11 @@ import styles from './postHeader.module.scss'; import { DeadlineLabel } from '../common/label/DeadlineLabel'; import { calculateDday } from '../../utils/dateUtils'; import { Image } from '../common/image/Image'; +import { getCategoryLabel } from '../../utils/categoryMapping.ts'; interface PostHeaderProps { tab: string; - category: string; + specialization: string; title: string; deadline?: string; postImage?: string | null; @@ -15,7 +16,7 @@ interface PostHeaderProps { export const PostHeader = ({ tab, - category, + specialization, title, deadline, postImage, @@ -23,6 +24,7 @@ export const PostHeader = ({ }: PostHeaderProps) => { const navigate = useNavigate(); const dDay = deadline ? calculateDday(deadline) : undefined; + const FORMATTED_SPECIALIZATION = getCategoryLabel(specialization); const handleEditNavigate = () => { let editPath = '/'; @@ -53,7 +55,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..79b49257 100644 --- a/src/components/my-page/apply/ApplyDetailsInfo.tsx +++ b/src/components/my-page/apply/ApplyDetailsInfo.tsx @@ -1,36 +1,52 @@ +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; - category: string; + specialization: string; itemName: string; part: string; } export const ApplyDetailsInfo = ({ + postId, tab, - category, + specialization, itemName, part, }: ApplyDetailsInfoProps) => { + const navigate = useNavigate(); + const handleNavigate = () => { + if (tab === '요청 과제') navigate(`/request-assign/registered/${postId}`); + if (tab === '협업 광장') + navigate(`/collaboration/postdetailwithlink/${postId}`); + }; + + const FORMMATED_SPECIALIZATION = getCategoryLabel(specialization); + const FORMMATED_PART = getCategoryLabel(part); + return ( <>
- {tab} > {category} + {tab} > {FORMMATED_SPECIALIZATION}
{itemName}
지원파트 - {part} + {FORMMATED_PART}
- + 화살표 + + {isMessageModalOpen && ( + + )}
diff --git a/src/components/my-page/apply/PurchaseDetailsInfo.tsx b/src/components/my-page/apply/PurchaseDetailsInfo.tsx index f7fb3f08..a939116c 100644 --- a/src/components/my-page/apply/PurchaseDetailsInfo.tsx +++ b/src/components/my-page/apply/PurchaseDetailsInfo.tsx @@ -1,37 +1,53 @@ +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; - category: string; + specialization: string; itemName: string; price: number; + quantity: number; } export const PurchaseDetailsInfo = ({ + ideaId, tab, - category, + specialization, itemName, price, + quantity, }: PurchaseDetailsInfoProps) => { + const FORMATTED_SPECIALIZATION = getCategoryLabel(specialization); + + const navigate = useNavigate(); + const handleNavigate = () => { + console.log('ideaId', ideaId); + navigate(`/idea-market/registered/${ideaId}`); + }; + return ( <>
- {tab} > {category} + {tab} > {FORMATTED_SPECIALIZATION}
{itemName}
-
{price.toLocaleString()}
+
{price.toLocaleString()} 원
수량 - 1개 + {quantity}개
-
diff --git a/src/pages/my-page/apply/ApplyRequest.tsx b/src/pages/my-page/apply/ApplyRequest.tsx index 5f74573c..54dc0049 100644 --- a/src/pages/my-page/apply/ApplyRequest.tsx +++ b/src/pages/my-page/apply/ApplyRequest.tsx @@ -90,8 +90,9 @@ export const ApplyRequest = () => { /> @@ -117,8 +118,9 @@ export const ApplyRequest = () => {
diff --git a/src/pages/my-page/apply/PurchaseList.tsx b/src/pages/my-page/apply/PurchaseList.tsx index 6ef7e283..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 = { - cardTitle: '구매 상세 내역', - labelText: '기업', - labelType: 'corporate', - }; const { data: purchases = [], isLoading, @@ -43,19 +38,21 @@ export const PurchaseList = () => { date={purchase.purchasedAt} status='구매 완료' statusType='purchaseCompleted' - cardTitle={FORM_DATA.cardTitle} + cardTitle={'구매 상세 내역'} />
{ <> {
{ <> { @@ -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] ?? '개인'; +};