-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
메인 전공 사진 변경, 면접 기록 퍼블리싱, 지원자 관리 페이지 연동
- Loading branch information
은지
committed
Feb 29, 2024
1 parent
4fead17
commit 66734b1
Showing
28 changed files
with
395 additions
and
115 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,84 +1,198 @@ | ||
import { Link } from "react-router-dom"; | ||
import styled from "styled-components"; | ||
import { instance } from "../apis/axios"; | ||
import { useEffect, useState } from "react"; | ||
import ApplicantModal from "./applicantModal"; | ||
|
||
interface Props { | ||
interface Applicant { | ||
classNumber: string; | ||
name: string; | ||
info: string; | ||
hopeMajor: string; | ||
interviewStartTime: string; | ||
interviewEndTime: string; | ||
reportPassingResult: string; | ||
interviewPassingResult: string; | ||
} | ||
|
||
const ApplicantMgt: React.FC<Props> = (props) => { | ||
const MajorLabel = (hopeMajor: string) => { | ||
switch (hopeMajor) { | ||
case "FRONT": | ||
return "프론트엔드"; | ||
case "BACK": | ||
return "백엔드"; | ||
case "SECURITY": | ||
return "보안"; | ||
case "IOS": | ||
return "아이오에스"; | ||
case "AND": | ||
return "안드로이드"; | ||
case "FLUTTER": | ||
return "플러터"; | ||
case "EMBEDDED": | ||
return "임베디드"; | ||
case "AI": | ||
return "인공지능"; | ||
case "DEVOPS": | ||
return "데브옵스"; | ||
case "DESIGN": | ||
return "디자인"; | ||
case "GAME": | ||
return "게임개발"; | ||
default: | ||
return "알 수 없음"; | ||
} | ||
}; | ||
|
||
const reportresultLabel = (reportPassingResult: string) => { | ||
switch (reportPassingResult) { | ||
case "PASS": | ||
return "합격"; | ||
case "FAIL": | ||
return "불합격"; | ||
case "WAIT": | ||
return "대기"; | ||
} | ||
}; | ||
|
||
const interviewresultLabel = (interviewPassingResult: string) => { | ||
switch (interviewPassingResult) { | ||
case "PASS": | ||
return "합격"; | ||
case "FAIL": | ||
return "불합격"; | ||
case "WAIT": | ||
return "대기"; | ||
} | ||
}; | ||
|
||
const ApplicantMgt = () => { | ||
const [applicants, setApplicants] = useState<Applicant[]>([]); | ||
const [selectedApplicant, setSelectedApplicant] = useState<Applicant | null>( | ||
null | ||
); | ||
const [isModalVisible, setIsModalVisible] = useState(false); | ||
|
||
const handleModalToggle = () => { | ||
setIsModalVisible(!isModalVisible); | ||
}; | ||
|
||
const handleApplicantClick = (applicant: Applicant) => { | ||
setSelectedApplicant(applicant); | ||
handleModalToggle(); | ||
}; | ||
|
||
const fetchData = async () => { | ||
await instance | ||
.get("/report/applicant/대동여지도") | ||
.then((res) => { | ||
setApplicants(res.data); | ||
console.log(res); | ||
}) | ||
.catch((err) => { | ||
console.log(err); | ||
}); | ||
}; | ||
|
||
useEffect(() => { | ||
fetchData(); | ||
}, []); | ||
|
||
return ( | ||
<Container> | ||
<ApplicantWrapper> | ||
<Applicant> | ||
<ApplicantName to="/ApplicantDetail">{props.name}</ApplicantName> | ||
<ApplicantInfo>{props.info}</ApplicantInfo> | ||
</Applicant> | ||
<Button> | ||
<PassBtn>합격</PassBtn> | ||
<FailureBtn>불합격</FailureBtn> | ||
</Button> | ||
</ApplicantWrapper> | ||
{applicants && | ||
applicants.map((applicant, index) => ( | ||
<Box> | ||
<Application key={index}> | ||
<Applicant> | ||
<ApplicantName onClick={() => handleApplicantClick(applicant)}> | ||
{applicant.name} | ||
</ApplicantName> | ||
<ApplicantInfo> | ||
{applicant.classNumber} | ||
{MajorLabel(applicant.hopeMajor)} | ||
</ApplicantInfo> | ||
<ApplicantTime> | ||
면접 일시 : {applicant.interviewStartTime} ~ | ||
{applicant.interviewEndTime} | ||
</ApplicantTime> | ||
</Applicant> | ||
<ResultWrapper> | ||
<ReportInterview> | ||
서류 :{reportresultLabel(applicant.reportPassingResult)} | ||
</ReportInterview> | ||
<ReportInterview> | ||
면접 :{interviewresultLabel(applicant.interviewPassingResult)} | ||
</ReportInterview> | ||
</ResultWrapper> | ||
</Application> | ||
</Box> | ||
))} | ||
<Modal> | ||
{selectedApplicant && isModalVisible && ( | ||
<ApplicantModal onModalToggle={handleModalToggle} /> | ||
)} | ||
</Modal> | ||
</Container> | ||
); | ||
}; | ||
|
||
const Container = styled.div``; | ||
const Container = styled.div` | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, 300px 300px 300px); | ||
row-gap: 16px; | ||
column-gap: 60px; | ||
`; | ||
|
||
const ApplicantWrapper = styled.div` | ||
width: 370px; | ||
height: 110px; | ||
display: flex; | ||
padding: 16px 36px; | ||
justify-content: space-between; | ||
align-items: center; | ||
const Modal = styled.div` | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
`; | ||
|
||
const Box = styled.div` | ||
height: 123px; | ||
padding: 15px; | ||
border: 1px solid rgba(110, 110, 135, 0.5); | ||
background-color: white; | ||
border-radius: 10px; | ||
`; | ||
|
||
const Application = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
`; | ||
|
||
const Applicant = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 5px; | ||
`; | ||
|
||
const ApplicantName = styled(Link)` | ||
font-size: 32px; | ||
font-weight: 900; | ||
const ApplicantName = styled.p` | ||
font-size: 36px; | ||
font-family: "DXhimchanBold"; | ||
cursor: pointer; | ||
&:hover { | ||
text-decoration: underline; | ||
} | ||
`; | ||
|
||
const ApplicantInfo = styled.p` | ||
font-size: 16px; | ||
font-weight: 500; | ||
font-size: 20px; | ||
`; | ||
|
||
const Button = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
const ApplicantTime = styled.p` | ||
font-size: 16px; | ||
`; | ||
|
||
const PassBtn = styled.div` | ||
const ResultWrapper = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100px; | ||
height: 35px; | ||
border-radius: 8px; | ||
color: #ffffff; | ||
background-color: #ffb800; | ||
padding: 8px 28px; | ||
cursor: pointer; | ||
flex-direction: column; | ||
gap: 5px; | ||
`; | ||
|
||
const FailureBtn = styled.div` | ||
width: 100px; | ||
height: 35px; | ||
border-radius: 8px; | ||
color: #ffffff; | ||
background-color: #6e6e87; | ||
padding: 8px 24px; | ||
cursor: pointer; | ||
const ReportInterview = styled.div` | ||
font-size: 13px; | ||
`; | ||
|
||
export default ApplicantMgt; |
Oops, something went wrong.