-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 나눔 상세내역 조회, 나눔 신청자 정보 조회 API 연동 (#32)
* feat: 나눔 상세내역 조회 API 연동 * feat: 나눔 상세내역 > 신청자 정보 조회 API 연동 * fix: 나눔 목록 조회 API type 수정
- Loading branch information
1 parent
c269340
commit d68a39d
Showing
11 changed files
with
131 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
import type { ShareApplicantData } from '@/types/share'; | ||
import { returnProfileImg } from '@/utils/returnProfileImg'; | ||
|
||
const ShareApplicantListItem: React.FC<{ | ||
idx: number; | ||
data: ShareApplicantData; | ||
}> = ({ idx, data }) => { | ||
return ( | ||
<div className="flex items-center mb-[20px]"> | ||
<p className="flex justify-center items-center w-[20px] h-[20px] rounded-full bg-gray0 body2-semibold text-gray5"> | ||
{idx} | ||
</p> | ||
<Image | ||
src={returnProfileImg(data.profileImage)} | ||
width={40} | ||
height={40} | ||
className="w-[40px] h-[40px] aspect-square mx-[8px]" | ||
alt="신청자 프로필" | ||
/> | ||
<p className="text-gray7 heading4-semibold">{data.nickname}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ShareApplicantListItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export { default as useGetShares } from './useGetShares'; | ||
export { default as useGetShareDetail } from './useGetShareDetail'; | ||
export { default as useGetShareApplicants } from './useGetShareApplicants'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import type { ShareApplicantData } from '@/types/share'; | ||
import { queryKeys } from '../queryKeys'; | ||
import { useBaseQuery } from '../useBaseQuery'; | ||
|
||
const useGetShareApplicants = ({ | ||
id, | ||
}: { | ||
id: string | string[] | undefined; | ||
}) => { | ||
if (typeof id !== 'string') { | ||
return null; | ||
} | ||
const { data } = useBaseQuery<ShareApplicantData[]>( | ||
queryKeys.SHARE_APPLICANTS(), | ||
`/shares/${id}/applies`, | ||
); | ||
|
||
return data?.data; | ||
}; | ||
|
||
export default useGetShareApplicants; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { ShareDetailData } from '@/types/share'; | ||
import { queryKeys } from '../queryKeys'; | ||
import { useBaseQuery } from '../useBaseQuery'; | ||
|
||
const useGetShareDetail = ({ id }: { id: string | string[] | undefined }) => { | ||
if (typeof id !== 'string') { | ||
return null; | ||
} | ||
const { data } = useBaseQuery<ShareDetailData>( | ||
queryKeys.SHARE_DETAIL(), | ||
`/shares/${id}`, | ||
); | ||
|
||
return data?.data; | ||
}; | ||
|
||
export default useGetShareDetail; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
import type { ProfileEnum } from '../common'; | ||
|
||
interface ShareData { | ||
shareId: number; | ||
title: string; | ||
itemName: string; | ||
content: string; | ||
shareTime: { | ||
hour: number; | ||
minute: number; | ||
second: number; | ||
nano: number; | ||
}; | ||
shareTime: string; | ||
shareDate: string; | ||
limitDate: string; | ||
limitPerson: number; | ||
location: string; | ||
status: string; | ||
thumbNailImage: string; | ||
} | ||
|
||
interface ShareDetailData extends ShareData { | ||
userName: string; | ||
profileImage: ProfileEnum; | ||
} | ||
|
||
interface ShareApplicantData { | ||
nickname: string; | ||
profileImage: ProfileEnum; | ||
} |