-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(volunteer): 봉사모집글 검색 페이지 msw 연결 및 무한 스크롤 기능 추가 (#164)
* feat(volunteer): volunteerRecruitItem 에서 모집완료 상태에 따라 다른 Label 을 보여주는 기능 추가 * refactor(volunteer): createRecruitItem 함수를 util 함수로 분리 * fix(volunteer): recruitmentSearchFilter 타입의 keywordFilter 에 IS_SHELTER 추가 * feat(volunteer): 봉사모집글 검색페이지에 사용할 period 를 date 로 변환하는 util 함수 추가 * feat(volunteer): 봉사모집글 검색페이지에 msw 연결 및 무한 스크롤 기능 추가 * feat(volunteer): 봉사 모집글 검색 API response 에 recruitmentDeadline 추가 * feat(volunteer): 봉사 모집글 아이템에 디데이 계산 기능 추가 * feat(shared): 검색 period 관련 상수, 타입, 함수를 shared 로 이동 * refactor(shared): 공통화된 검색 period 를 보호소앱과 봉사자앱에서 사용하도록 수정
- Loading branch information
Showing
15 changed files
with
111 additions
and
71 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
7 changes: 0 additions & 7 deletions
7
apps/shelter/src/pages/volunteers/search/_constants/filter.ts
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
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,32 @@ | ||
import { createFormattedTime, getDDay } from 'shared/utils/date'; | ||
|
||
import { Recruitment } from '@/types/apis/recruitment'; | ||
|
||
export const createRecruitmentItem = (recruitment: Recruitment) => { | ||
const { | ||
recruitmentId, | ||
recruitmentTitle, | ||
shelterName, | ||
shelterImageUrl, | ||
recruitmentApplicantCount, | ||
recruitmentCapacity, | ||
recruitmentStartTime, | ||
recruitmentDeadline, | ||
recruitmentIsClosed, | ||
} = recruitment; | ||
|
||
return { | ||
id: recruitmentId, | ||
title: recruitmentTitle, | ||
shelterName: shelterName, | ||
shelterProfileImage: shelterImageUrl, | ||
isRecruitmentClosed: recruitmentIsClosed, | ||
volunteerDate: createFormattedTime( | ||
new Date(recruitmentStartTime), | ||
'YY.MM.DD', | ||
), | ||
volunteerDateDday: getDDay(recruitmentDeadline), | ||
applicantCount: recruitmentApplicantCount, | ||
recruitmentCapacity: recruitmentCapacity, | ||
}; | ||
}; |
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
7 changes: 0 additions & 7 deletions
7
apps/volunteer/src/pages/volunteers/search/_constants/filter.ts
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
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,6 @@ | ||
export const PERIOD = { | ||
WITHIN_ONE_DAY: '1일 이내', | ||
WITHIN_ONE_WEEK: '1주 이내', | ||
WITHIN_ONE_MONTH: '1달 이내', | ||
WITHIN_THREE_MONTH: '3달 이내', | ||
} as const; |
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,3 @@ | ||
import { PERIOD } from '../constants/period'; | ||
|
||
export type Period = keyof typeof PERIOD; |
5 changes: 2 additions & 3 deletions
5
.../pages/volunteers/search/_utils/period.ts → packages/shared/utils/period.ts
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