-
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: 공고에 대한 지원자 목록 페이지 구현 및 api 정의하기 #50
- Loading branch information
Showing
18 changed files
with
371 additions
and
48 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
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
108 changes: 108 additions & 0 deletions
108
src/components/Employer/ApplicantList/EmployerApplicantCard.tsx
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,108 @@ | ||
import { APPLICATION_STEP } from '@/constants/application'; | ||
import { | ||
ApplicantItemType, | ||
ApplicationStepType, | ||
} from '@/types/application/applicationItem'; | ||
import ClockIcon from '@/assets/icons/ClockIcon.svg?react'; | ||
import MoneyIcon from '@/assets/icons/MoneyIcon.svg?react'; | ||
import RightArrowIcon from '@/assets/icons/RightArrowIcon.svg?react'; | ||
import Tag from '@/components/Common/Tag'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
const statusStyler = (status: ApplicationStepType) => { | ||
switch (status) { | ||
case APPLICATION_STEP.APPLICATION_SUCCESS: | ||
return 'bg-[#C7C6F6]'; | ||
case APPLICATION_STEP.RESUME_REJECTED: | ||
return 'bg-[#FFC6C0]'; | ||
case APPLICATION_STEP.APPLICATION_REJECTED: | ||
return 'bg-[#FFC6C0]'; | ||
case APPLICATION_STEP.PENDING: | ||
return 'bg-[#BDBDBD]'; | ||
default: | ||
return 'bg-[#FEF387]'; | ||
} | ||
}; | ||
|
||
type EmployerApplicantCardPropsType = { | ||
applicantData: ApplicantItemType; | ||
}; | ||
|
||
const EmployerApplicantCard = ({ | ||
applicantData, | ||
}: EmployerApplicantCardPropsType) => { | ||
const navigate = useNavigate(); | ||
return ( | ||
<article className="w-full border-[0.031rem] border-[#1E19263D] rounded-[1.125rem] overflow-hidden"> | ||
<div | ||
className={`flex justify-between items-center px-[1rem] py-[0.5rem] ${statusStyler(applicantData.step)}`} | ||
> | ||
<div className="flex gap-[0.25rem]"> | ||
<p className="pl-[0.5rem] caption-1 text-[#1E1926]"> | ||
{applicantData.step.replace(/_/g, ' ').toLowerCase()} | ||
</p> | ||
<div className="w-[0.375rem] h-[0.375rem] rounded-full bg-[#FF6F61]"></div> | ||
</div> | ||
<RightArrowIcon | ||
onClick={() => navigate(`/employer/application/${applicantData.id}`)} | ||
/> | ||
</div> | ||
<div className="flex justify-between w-full px-[1.5rem] pt-[1rem] pb-[0.75rem]"> | ||
<div className="flex gap-[0.75rem]"> | ||
<div className='w-[2.5rem] h-[2.5rem] rounded-[0.5rem] bg-cover bg-[url("/src/assets/images/JobIconExample.jpeg")]'></div> | ||
<div> | ||
<h3 className="pb-[0.25rem] head-3 text-[#1E1926]"> | ||
{applicantData.name} | ||
</h3> | ||
<p className="body-3 text-[#464646]">{applicantData.nationality}</p> | ||
</div> | ||
</div> | ||
<Tag | ||
value={`${applicantData.duration_of_days}days After`} | ||
padding="0.25rem 0.438rem" | ||
isRounded={false} | ||
hasCheckIcon={false} | ||
backgroundColor="#1E1926" | ||
color="#F4F4F9" | ||
fontStyle="caption-2" | ||
/> | ||
</div> | ||
<div className="flex flex-col gap-[0.125rem] w-full px-[1.5rem] pb-[0.75rem]"> | ||
<div className="flex items-center gap-[0.5rem] px-[0.5rem]"> | ||
<ClockIcon className="min-w-[0.5rem]" /> | ||
<p className="text-[#464646] caption-1">{applicantData.gender}</p> | ||
</div> | ||
<div className="flex items-center gap-[0.5rem] px-[0.5rem]"> | ||
<MoneyIcon className="min-w-[0.5rem]" /> | ||
<p className="text-[#464646] caption-1"> | ||
{applicantData.school_name} | ||
</p> | ||
</div> | ||
<div className="flex items-center gap-[0.5rem] px-[0.5rem]"> | ||
<ClockIcon className="min-w-[0.5rem]" /> | ||
<p className="text-[#464646] caption-1"> | ||
{applicantData.visa.replace(/_/g, '-')} | ||
</p> | ||
</div> | ||
</div> | ||
<div className="flex flex-col gap-[0.625rem] px-[1rem] pb-[1rem]"> | ||
<button | ||
className="w-full px-[1.5rem] py-[0.75rem] text-center rounded-full bg-[#1E1926] text-[#F4F4F9] caption-1-sb" | ||
onClick={() => navigate(`/employer/application/${applicantData.id}`)} | ||
> | ||
Check Application Status | ||
</button> | ||
<button | ||
className="w-full px-[1.5rem] py-[0.75rem] text-center rounded-full bg-[#FEF387] text-[#1E1926] caption-1-sb" | ||
onClick={() => | ||
navigate(`/employer/application/resume/${applicantData.id}`) | ||
} | ||
> | ||
See Resume | ||
</button> | ||
</div> | ||
</article> | ||
); | ||
}; | ||
|
||
export default EmployerApplicantCard; |
61 changes: 61 additions & 0 deletions
61
src/components/Employer/ApplicantList/EmployerApplicantList.tsx
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,61 @@ | ||
import SearchSortDropdown from '@/components/Common/SearchSortDropdown'; | ||
import EmployerApplicationCard from '@/components/Employer/ApplicantList/EmployerApplicantCard'; | ||
import { | ||
APPLICANT_LIST_DATA, | ||
KO_APPLICATION_STATUS_TYPE, | ||
} from '@/constants/application'; | ||
import { KO_ASCENDING_SORT_TYPE } from '@/constants/sort'; | ||
import { ApplicantItemType } from '@/types/application/applicationItem'; | ||
import { KoApplicationStatusType } from '@/types/application/applicationStatus'; | ||
import { KoAscendingSortType } from '@/types/common/sort'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
type EmployerApplicationListPropsType = { | ||
title: string; | ||
}; | ||
|
||
const EmployerApplicationList = ({ | ||
title, | ||
}: EmployerApplicationListPropsType) => { | ||
const [applicantList, setApplicantList] = useState<ApplicantItemType[]>([]); | ||
const [selectedSort, setSelectedSort] = useState<KoAscendingSortType>( | ||
KO_ASCENDING_SORT_TYPE.ASCENDING, | ||
); | ||
const [selectedStatus, setSelectedStatus] = useState<KoApplicationStatusType>( | ||
KO_APPLICATION_STATUS_TYPE.INPROGRESS, | ||
); | ||
|
||
useEffect(() => { | ||
// TODO: 4.6 호출하기 | ||
setApplicantList(APPLICANT_LIST_DATA); | ||
}, [selectedSort, selectedStatus]); | ||
|
||
return ( | ||
<section className="flex flex-col gap-[1rem] w-full p-[1.5rem] pb-[6.25rem]"> | ||
<div className="flex justify-between items-center"> | ||
<h3 className="px-[0.5rem] head-3 text-[#1E1926]"> | ||
<span className="pr-[0.25rem] text-[#7872ED]">{title}</span>의 지원자 | ||
</h3> | ||
<div className="flex gap-[0.25rem] whitespace-nowrap"> | ||
<SearchSortDropdown | ||
options={Object.values(KO_ASCENDING_SORT_TYPE)} | ||
value={selectedSort} | ||
onSelect={(sort) => setSelectedSort(sort as KoAscendingSortType)} | ||
/> | ||
<SearchSortDropdown | ||
options={Object.values(KO_APPLICATION_STATUS_TYPE)} | ||
value={selectedStatus} | ||
onSelect={(sort) => | ||
setSelectedStatus(sort as KoApplicationStatusType) | ||
} | ||
/> | ||
</div> | ||
</div> | ||
{applicantList?.map((data) => ( | ||
<EmployerApplicationCard key={data.id} applicantData={data} /> | ||
))} | ||
</section> | ||
); | ||
}; | ||
|
||
export default EmployerApplicationList; |
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
Oops, something went wrong.