Skip to content

Commit

Permalink
Merge pull request #1370 from 42organization/fix/bug-공고-페이지-버그-수정
Browse files Browse the repository at this point in the history
[Feat/Fix] 유저 공고 페이지 버그 수정, 헤더에 메인 이동 버튼 추가
  • Loading branch information
yoouyeon authored Apr 8, 2024
2 parents 46490ad + 6bb15a6 commit 5689ef3
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 81 deletions.

This file was deleted.

4 changes: 2 additions & 2 deletions components/recruit/Main/MyRecruitStatus.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Stack } from '@mui/material';
import { resultType } from 'types/recruit/recruitments';
import { dateToKRFullString } from 'utils/handleTime';
import RecruitStepper from 'components/recruit/Main/RecruitStepper';
import style from 'styles/recruit/Main/myRecruitment.module.scss';
import RecruitStepper from './RecruitStepper';

const MyRecruitStatus = ({
status,
Expand Down Expand Up @@ -34,7 +34,7 @@ const MyRecruitStatus = ({
};

const statusMessage = (status: resultType, interviewDate?: Date) => {
if (status === 'PROGRESS') return '지원서를 확인하고 있습니다.';
if (status === 'PROGRESS_DOCS') return '지원서를 확인하고 있습니다.';
if (status === 'INTERVIEW' && interviewDate)
return dateToKRFullString(new Date(interviewDate));
if (status === 'PASS') return '합격';
Expand Down
6 changes: 3 additions & 3 deletions components/recruit/Main/MyRecruitment.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useRouter } from 'next/router';
import { List } from '@mui/material';
import CollapseListItem from 'components/recruit/Main/CollapseListItem';
import MyApplicationInfo from 'components/recruit/Main/MyApplicationInfo';
import MyRecruitStatus from 'components/recruit/Main/MyRecruitStatus';
import useGetRecruitResult from 'hooks/recruit/useGetRecruitResult';
import style from 'styles/recruit/Main/myRecruitment.module.scss';
import textStyle from 'styles/recruit/text.module.scss';
import CollapseListItem from './CollapseListItem';
import MyApplicationInfo from './MyApplicationInfo';
import MyRecruitStatus from './MyRecruitStatus';

const MyRecruitment = ({ applicationId }: { applicationId?: number }) => {
const router = useRouter();
Expand Down
2 changes: 1 addition & 1 deletion components/recruit/Main/RecruitStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const RecruitStepper = ({ status }: { status: resultType }) => {
const stepMessage = ['지원서 확인', '면접', '결과 발표'];

const statusToStep = (status: resultType) => {
if (status === 'PROGRESS') return 0;
if (status === 'PROGRESS_DOCS') return 0;
if (status === 'INTERVIEW' || status === 'APPLICATION_FAIL') return 1; // 면접 전 상태
if (status === 'PASS' || status === 'INTERVIEW_FAIL') return 2; // 면접 후 상태
return 0;
Expand Down
22 changes: 19 additions & 3 deletions components/recruit/StickyHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
import { usePathname, useRouter } from 'next/navigation';
import { HomeOutlined } from '@mui/icons-material';
import { Button } from '@mui/material';
import commonStyle from 'styles/recruit/common.module.scss';
import textStyle from 'styles/recruit/text.module.scss';

const StickyHeader = ({ headerTitle }: { headerTitle: string }) => {
const router = useRouter();
const pathName = usePathname();
const goHome = () => {
router.push('/recruit');
};
return (
<div className={commonStyle.stickyHeader}>
<div className={commonStyle.stickyContainer}>
<span className={textStyle.pageTitle}>{headerTitle}</span>
</div>
<span className={textStyle.headerTitle}>{headerTitle}</span>
{pathName !== '/recruit' && (
<Button
className={commonStyle.homeBtn}
variant='text'
startIcon={<HomeOutlined />}
onClick={goHome}
>
모집 메인
</Button>
)}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const before = {

const beforeInterview = {
title: '면접 시간 발표 전입니다~',
status: 'PROGRESS',
status: 'PROGRESS_DOCS',
interviewDate: null,
};

Expand Down
4 changes: 2 additions & 2 deletions pages/recruit/[id]/apply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useEffect } from 'react';
import { useSetRecoilState } from 'recoil';
import { applicationAlertState } from 'utils/recoil/application';
import ApplicationForm from 'components/recruit/Application/ApplicationForm';
import ApplicationFormHeader from 'components/recruit/Application/applicationLayout/ApplicationFormHeader';
import ApplicationLoadingNoData from 'components/recruit/Application/ApplicationLoadingNoData';
import StickyHeader from 'components/recruit/StickyHeader';
import useRecruitDetail from 'hooks/recruit/useRecruitDetail';

function Apply() {
Expand All @@ -31,7 +31,7 @@ function Apply() {

return (
<>
<ApplicationFormHeader title={'지원서 작성'} />
<StickyHeader headerTitle={'지원서 작성'} />
<ApplicationForm
recuitId={recruitId}
applicationId={null}
Expand Down
6 changes: 3 additions & 3 deletions pages/recruit/[id]/my-application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { ApplicationFormType } from 'types/recruit/recruitments';
import { applicationAlertState } from 'utils/recoil/application';
import ApplicationForm from 'components/recruit/Application/ApplicationForm';
import ApplicatoinFormFooter from 'components/recruit/Application/applicationLayout/ApplicationFormFooter';
import ApplicationFormHeader from 'components/recruit/Application/applicationLayout/ApplicationFormHeader';
import ApplicationLoadingNoData from 'components/recruit/Application/ApplicationLoadingNoData';
import StickyHeader from 'components/recruit/StickyHeader';
import useRecruitDetail from 'hooks/recruit/useRecruitDetail';
import useRecruitDetailUser from 'hooks/recruit/useRecruitDetailUser';

Expand Down Expand Up @@ -63,8 +63,8 @@ function MyApplication() {

return (
<>
<ApplicationFormHeader
title={mode === 'VIEW' ? '지원서 확인' : '지원서 수정'}
<StickyHeader
headerTitle={mode === 'VIEW' ? '지원서 확인' : '지원서 수정'}
/>
<ApplicationForm
recuitId={recruitId}
Expand Down
24 changes: 0 additions & 24 deletions styles/recruit/application.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,6 @@
}
}

.stickyHeader {
position: sticky;
top: 0;
z-index: 1;
width: 100%;
background-color: rgba(246, 246, 246, 0.7);
backdrop-filter: blur(5px);

.stickyContainer {
display: flex;
height: 5rem;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
justify-content: space-around;
.pageTitle {
font-size: 2rem;
}
.homeBtn {
height: 3rem;
font-size: $medium-font;
}
}
}

.stickyFooter {
position: sticky;
bottom: 0;
Expand Down
15 changes: 10 additions & 5 deletions styles/recruit/common.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import 'styles/common.scss';

.pingpongAnimation {
margin: 1rem 0;
}
Expand All @@ -6,13 +8,16 @@
position: sticky;
top: 0;
z-index: 1;
box-sizing: border-box;
display: flex;
width: 100%;
height: fit-content;
padding: 1rem 1.5rem;
background-color: rgba(246, 246, 246, 0.9);
backdrop-filter: blur(5px);
.stickyContainer {
height: 4rem;
padding-top: 1.5rem;
padding-bottom: 1.5rem;
padding-left: 2rem;
align-items: center;
justify-content: space-between;
.homeBtn {
font-size: $medium-font;
}
}
2 changes: 1 addition & 1 deletion styles/recruit/layout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.noRecruit {
display: flex;
width: 100%;
height: 100%;
flex-grow: 1;
flex-direction: column;
align-items: center;
justify-content: center;
Expand Down
4 changes: 4 additions & 0 deletions styles/recruit/text.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
@include pageSubTitle;
text-align: center;
}

.headerTitle {
@include pageTitle;
}
2 changes: 1 addition & 1 deletion types/recruit/recruitments.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type recruitmentListData = {

export type resultType =
| null
| 'PROGRESS'
| 'PROGRESS_DOCS'
| 'APPLICATION_FAIL'
| 'INTERVIEW'
| 'PASS'
Expand Down

0 comments on commit 5689ef3

Please sign in to comment.