Skip to content

Commit

Permalink
✨feat: 고용주 메인 페이지 구현하기 및 메인 페이지에서 페이지 이동들 연결하기 Team-inglo#61
Browse files Browse the repository at this point in the history
  • Loading branch information
naarang committed Oct 29, 2024
1 parent eb54277 commit 3c0879c
Show file tree
Hide file tree
Showing 26 changed files with 472 additions and 41 deletions.
9 changes: 9 additions & 0 deletions src/api/alarm.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { api } from '.';

// 10.1 (유학생/고용주) 알림 조회
export const getAlarms = async (page: number, size: number) => {
const response = await api.get(
`/notifications/overviews?page=${page}&size=${size}`,
);
return response.data;
};
70 changes: 69 additions & 1 deletion src/api/application.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
import { PatchResumeAcceptedRequest } from '@/types/api/application';
import {
PatchHiKoreaResultRequest,
PatchResumeAcceptedRequest,
} from '@/types/api/application';
import { api } from '.';

// 4.8 (유학생) 공고 지원 자격 확인하기
export const getPostValidation = async (id: number) => {
const response = await api.get(`/users/job-postings/${id}/validation`);
return response.data;
};

// 4.9 (유학생) 공고 지원하기
export const postApplyPost = async (id: number) => {
const response = await api.post(`/users/job-postings/${id}`);
return response.data;
};

// 6.2 (유학생) 지원 상태 상세 조회하기
export const getApplicationDetail = async (id: number) => {
const response = await api.get(
`/users/user-owner-job-postings/${id}/details`,
);
return response.data;
};

// 6.5 (유학생) 공고 담당자 정보 조회하기
export const getRecruiterInfo = async (id: number) => {
const response = await api.get(
`/users/user-owner-job-postings/${id}/job-postings/recruiters`,
);
return response.data;
};

// 6.7 (고용주) 지원자 지원 상태 상세 조회
export const getEmployerApplicationDetail = async (id: number) => {
const response = await api.get(
Expand Down Expand Up @@ -39,3 +70,40 @@ export const patchInterviewFinish = async (id: number) => {
);
return response.data;
};

// 6.13 (유학생) 유학생 담당자 검토 완료
export const patchContactCoordinator = async (id: number) => {
const response = await api.patch(
`/users/user-owner-job-postings/${id}/step-document-under-review`,
);
return response.data;
};

// 6.14 (유학생) 하이코리아 지원
export const patchApplyHiKorea = async (id: number) => {
const response = await api.patch(
`/users/user-owner-job-postings/${id}/step-application-in-progress`,
);
return response.data;
};

// 6.15 (유학생) 하이코리아 처리결과 등록하기
export const patchHiKoreaResult = async ({
id,
body,
}: {
id: number;
body: PatchHiKoreaResultRequest;
}) => {
const response = await api.patch(
`/users/user-owner-job-postings/${id}/step-registering-results`,
body,
);
return response.data;
};

// 9.2 (유학생) 학교 정보 상세조회하기
export const getSchoolInfo = async () => {
const response = await api.get(`/users/resumes/schools/details`);
return response.data;
};
57 changes: 57 additions & 0 deletions src/api/post.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
import { AscendingSortType } from '@/types/common/sort';
import { api } from '.';
import { GetApplyPostListReqType, GetPostListReqType } from '@/types/api/post';
import { APPLICATION_STATUS_TYPE } from '@/constants/application';

// 4.2 (게스트) 공고 상세 조회하기
export const getPostDetailGuest = async (id: number) => {
const response = await api.get(`/guests/job-postings/${id}/details`);
return response.data;
};

// 4.3 (유학생/고용주) 공고 리스트 조회
export const getPostList = async (req: GetPostListReqType) => {
const response = await api.get(
`/job-postings/overviews?page=${req.page}&size=${req.size}&search=${req.search}&sorting=${req.sorting}&region_1depth=${req.region_1depth}&region_2depth=${req.region_2depth}&region_3depth=${req.region_3depth}&industry=${req.industry}&work_period=${req.work_period}&work_days_per_week=${req.work_days_per_week}&working_day=${req.working_day}&working_hours=${req.working_hours}&recruitment_period=${req.recruitment_period}&employment_type=${req.employment_type}&visa=${req.visa}&type=${req.type}`,
);
return response.data;
};

// 4.4 (유학생/고용주) 공고 상세 조회하기
export const getPostDetail = async (id: number) => {
const response = await api.get(`/job-postings/${id}/details`);
return response.data;
};

// 4.5 (유학생) 추천 공고 리스트 조회하기
export const getRecommendPostList = async () => {
const response = await api.get(`/users/job-postings/briefs`);
return response.data;
};

// 4.6 (고용주) 공고에 대한 지원자 리스트 조회
export const getApplicantList = async (
id: number,
Expand All @@ -28,12 +50,47 @@ export const getPostSummary = async (id: number) => {
return response.data;
};

// 4.12 (유학생) 북마크 추가/삭제
export const putPostBookmark = async (id: number) => {
const response = await api.put(`/users/job-postings/${id}/book-marks`);
return response.data;
};

// 4.13 (고용주) 공고 삭제하기
export const deletePost = async (id: number) => {
const response = await api.delete(`/owners/job-postings/${id}`);
return response.data;
};

// 5.1 (유학생) 북마크한 공고 리스트 조회하기
export const getBookmarkPostList = async (page: number, size: number) => {
const response = await api.get(
`/users/book-marks/overviews?page=${page}&size=${size}`,
);
return response.data;
};

// 6.1 (유학생) 지원한 공고 리스트 조회하기
export const getApplyPostList = async ({
page,
size,
sorting,
status,
}: GetApplyPostListReqType) => {
const response = await api.get(
`/users/user-owner-job-postings/overviews?page=${page}&size=${size}&sorting=${sorting}&${status === APPLICATION_STATUS_TYPE.TOTAL ? '' : `status=${status}`}`,
);
return response.data;
};

// 6.3 (유학생) 현재 진행중인 인터뷰 리스트 조회하기
export const getInterviewList = async (page: number, size: number) => {
const response = await api.get(
`/users/user-owner-job-postings/briefs?page=${page}&size=${size}`,
);
return response.data;
};

// 6.6 (고용주) 등록한 공고 리스트 조회하기
export const getEmployerPostList = async (sorting: AscendingSortType) => {
// TODO: 무한 스크롤 구현하기
Expand Down
5 changes: 5 additions & 0 deletions src/assets/icons/PlusIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import Button from '@/components/Common/Button';
import { buttonTypeKeys } from '@/constants/components';
import { useNavigate } from 'react-router-dom';

type PostDetailConfirmBottomSheetType = {
type LoginBottomSheetPropsType = {
isShowBottomsheet: boolean;
setIsShowBottomSheet: React.Dispatch<React.SetStateAction<boolean>>;
};

const PostDetailLoginBottomSheet = ({
const LoginBottomSheet = ({
isShowBottomsheet,
setIsShowBottomSheet,
}: PostDetailConfirmBottomSheetType) => {
}: LoginBottomSheetPropsType) => {
const navigate = useNavigate();

return (
Expand Down Expand Up @@ -72,4 +72,4 @@ const PostDetailLoginBottomSheet = ({
);
};

export default PostDetailLoginBottomSheet;
export default LoginBottomSheet;
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const EmployerApplicationList = ({
KO_ASCENDING_SORT_TYPE.ASCENDING,
);
const [selectedStatus, setSelectedStatus] = useState<KoApplicationStatusType>(
KO_APPLICATION_STATUS_TYPE.INPROGRESS,
KO_APPLICATION_STATUS_TYPE.TOTAL,
);

useEffect(() => {
Expand Down
8 changes: 7 additions & 1 deletion src/components/Home/HomeApplicationCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import TopRightArrowIcons from '@/assets/icons/Home/TopRightArrowIcon.svg?react';
import { OngoingInterviewItemType } from '@/types/home/ongoingInterviewItem';
import { useNavigate } from 'react-router-dom';

type HomeApplicationCardProps = {
applicationData: OngoingInterviewItemType;
};

const HomeApplicationCard = ({ applicationData }: HomeApplicationCardProps) => {
const navigate = useNavigate();

return (
<article className="flex flex-col gap-[0.5rem] px-[1.25rem] pt-[0.75rem] pb-[1.25rem] min-w-[17.5rem] bg-white rounded-[1rem] shadow-cardShadow">
<div className="w-fit px-[0.438rem] py-[0.125rem] caption-2 bg-[#1E1926] rounded-[0.188rem] text-[#F4F4F9]">
Expand All @@ -21,7 +24,10 @@ const HomeApplicationCard = ({ applicationData }: HomeApplicationCardProps) => {
{applicationData.address_name}
</p>
</div>
<button className="px-[0.75rem] py-[0.25rem] bg-[#1B1B1B] rounded-[1.313rem]">
<button
className="px-[0.75rem] py-[0.25rem] bg-[#1B1B1B] rounded-[1.313rem]"
onClick={() => navigate(`/application/${applicationData.id}`)}
>
<TopRightArrowIcons />
</button>
</div>
Expand Down
26 changes: 26 additions & 0 deletions src/components/Home/HomeEmployerBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import PlusIcon from '@/assets/icons/PlusIcon.svg?react';
import { useNavigate } from 'react-router-dom';

const HomeEmployerBanner = () => {
const navigate = useNavigate();
return (
<section className="w-full px-[1.5rem] pb-[2.75rem] bg-[#FEF387]">
<div className="flex flex-col justify-center items-center gap-[0.5rem] p-[1.5rem] rounded-[1.5rem] bg-cover bg-center bg-[url('/src/assets/images/yellowGradient.png')]">
<h3 className="head-3 text-[#1E1926] text-center">
Register your
<br />
new announcement
</h3>
{/* TODO: 공고 작성 페이지로 이동 필요 */}
<button
className="px-[1.5rem] py-[0.5rem] rounded-[1.313rem] bg-[#1B1B1B]"
onClick={() => navigate(`/employer/post`)}
>
<PlusIcon />
</button>
</div>
</section>
);
};

export default HomeEmployerBanner;
8 changes: 7 additions & 1 deletion src/components/Home/HomeGuestBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { useNavigate } from 'react-router-dom';

const HomeGuestBanner = () => {
const navigate = useNavigate();
return (
<section className="w-full px-[1.5rem] pb-[2.75rem] bg-[#FEF387]">
<div className="flex flex-col justify-center items-center gap-[0.25rem] relative px-[2.5rem] pt-[1rem] pb-[2rem] rounded-t-[1.5rem] bg-cover bg-center bg-[url('/src/assets/images/yellowGradient.png')]">
Expand All @@ -10,7 +13,10 @@ const HomeGuestBanner = () => {
Get personalized job recommendations, track your applications, and
access exclusive opportunities. Sign in now to get started!
</p>
<button className="absolute bottom-[-1.25rem] left-0 w-full py-[0.75rem] rounded-[1.25rem] text-center text-white button-2 bg-[#1E1926]">
<button
className="absolute bottom-[-1.25rem] left-0 w-full py-[0.75rem] rounded-[1.25rem] text-center text-white button-2 bg-[#1E1926]"
onClick={() => navigate('/signin')}
>
Sign In
</button>
</div>
Expand Down
Loading

0 comments on commit 3c0879c

Please sign in to comment.