Skip to content

Commit 9378528

Browse files
Merge pull request #149 from D3vPals/feat/#144
합/ 불합 페이지 구현 (issue #144)
2 parents 1850568 + 4f5703c commit 9378528

19 files changed

+417
-60
lines changed

src/api/applicant.api.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ export const patchPassNonPassStatus = async (
2626
);
2727
return response.data;
2828
};
29+
30+
export const getPassNonPassList = async (projectId: number) => {
31+
const response = await httpClient.get(
32+
`/project/${projectId}/applicant/summary`
33+
);
34+
return response.data;
35+
};

src/components/common/noContent/NoContent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ import * as S from './NoContent.styled';
22
import { DocumentTextIcon } from '@heroicons/react/24/outline';
33

44
interface NoContentProps {
5-
type: 'projects' | 'applicants';
5+
type: 'projects' | 'applicants' | 'passNonPass';
66
}
77

88
export default function NoContent({ type }: NoContentProps) {
99
const INPUT_CONTENT = {
1010
projects: '공고가',
1111
applicants: '지원자가',
12+
passNonPass: '합/불합격자 리스트가',
1213
};
1314

1415
return (
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import styled from 'styled-components';
2+
3+
export const TitleWrapper = styled.div`
4+
display: flex;
5+
justify-content: start;
6+
align-items: center;
7+
width: 100%;
8+
`;
9+
10+
export const RecruitmentEnd = styled.h3`
11+
margin-left: 1.2rem;
12+
font-size: 1rem;
13+
font-weight: 400;
14+
color: ${({ theme }) => theme.color.red};
15+
`;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import * as S from './ProjectHeader.styled';
2+
import Title from '../common/title/Title';
3+
import { ProjectDetailExtended } from '../../models/projectDetail';
4+
import RecruitmentDate from './RecruitmentDate';
5+
interface ProjectHeaderProps {
6+
projectData: ProjectDetailExtended;
7+
}
8+
9+
function ProjectHeader({ projectData }: ProjectHeaderProps) {
10+
return (
11+
<>
12+
<S.TitleWrapper>
13+
{projectData && <Title size='semiLarge'>{projectData.title} </Title>}
14+
{projectData?.isDone && <S.RecruitmentEnd>공고 마감</S.RecruitmentEnd>}
15+
</S.TitleWrapper>
16+
{projectData && <RecruitmentDate ProjectData={projectData} />}
17+
</>
18+
);
19+
}
20+
21+
export default ProjectHeader;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import styled from 'styled-components';
2+
3+
export const ItemWrapper = styled.li`
4+
display: flex;
5+
justify-content: space-between;
6+
align-items: center;
7+
width: 100%;
8+
padding: 1rem;
9+
border: 1px solid ${({ theme }) => theme.color.grey};
10+
border-radius: ${({ theme }) => theme.borderRadius.primary};
11+
&:hover {
12+
background-color: ${({ theme }) => theme.color.navy};
13+
color: ${({ theme }) => theme.color.white};
14+
}
15+
16+
svg {
17+
color: #e69191;
18+
width: 1.2rem;
19+
height: 1.2rem;
20+
}
21+
`;
22+
23+
export const NickName = styled.p`
24+
font-size: ${({ theme }) => theme.heading.small.fontSize};
25+
font-weight: 400;
26+
`;
27+
28+
export const DeleteButton = styled.button``;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { ApplicantInfo } from '../../../models/applicant';
2+
import * as S from './PassNonPassItem.styled';
3+
import { XCircleIcon } from '@heroicons/react/24/outline';
4+
5+
interface PassNonPassItemProps {
6+
userInfo: ApplicantInfo;
7+
}
8+
9+
function PassNonPassItem({ userInfo }: PassNonPassItemProps) {
10+
return (
11+
<S.ItemWrapper>
12+
<S.NickName>{userInfo.User.nickname}</S.NickName>
13+
<S.DeleteButton>
14+
<XCircleIcon />
15+
</S.DeleteButton>
16+
</S.ItemWrapper>
17+
);
18+
}
19+
20+
export default PassNonPassItem;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import styled from 'styled-components';
2+
3+
export const Wrapper = styled.ul`
4+
width: 100%;
5+
height: 27rem;
6+
min-width: 22rem;
7+
border-radius: ${({ theme }) => theme.borderRadius.primary};
8+
border: 1px solid ${({ theme }) => theme.color.border};
9+
padding: 1.6rem 2rem;
10+
gap: 1rem;
11+
display: flex;
12+
flex-direction: column;
13+
justify-content: start;
14+
align-items: center;
15+
overflow: hidden;
16+
overflow-y: auto;
17+
&::-webkit-scrollbar {
18+
display: none;
19+
}
20+
`;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { ApplicantInfo } from '../../../models/applicant';
2+
import PassNonPassItem from './PassNonPassItem';
3+
import * as S from './PassNonPassList.styled';
4+
5+
interface PassNonPassListProps {
6+
passNonPassListData: ApplicantInfo[];
7+
}
8+
9+
function PassNonPassList({ passNonPassListData }: PassNonPassListProps) {
10+
return (
11+
<S.Wrapper>
12+
{passNonPassListData.map((data) => (
13+
<PassNonPassItem key={data.userId} userInfo={data} />
14+
))}
15+
</S.Wrapper>
16+
);
17+
}
18+
19+
export default PassNonPassList;

src/hooks/queries/keys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const managedProjectsKey = {
55
export const applicantKey = {
66
all: ['applicantList'],
77
info: ['applicantInfo'],
8+
passNonPass: ['passNonPassList'],
89
};
910

1011
export const myInfoKey = {

src/hooks/usePassNonPassList.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { useQuery } from '@tanstack/react-query';
2+
import { applicantKey } from './queries/keys';
3+
import { getPassNonPassList } from '../api/applicant.api';
4+
5+
export const usePassNonPassList = (projectId: number) => {
6+
const { data } = useQuery({
7+
queryKey: applicantKey.passNonPass,
8+
queryFn: () => getPassNonPassList(projectId),
9+
staleTime: 1 * 60 * 1000,
10+
});
11+
12+
return { passNonPassListData: data };
13+
};

0 commit comments

Comments
 (0)