-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from tteokbokki-master/feat/resumeViewer
Feat/#90 μ΄λ ₯μ μ΄λ νμ΄μ§ ꡬν
- Loading branch information
Showing
8 changed files
with
137 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ const Section = styled.div` | |
align-items: center; | ||
margin-bottom: 52px; | ||
`; | ||
``` | ||
``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { getDynamicAPIPath } from '@/apis/apiPath'; | ||
import { clientInstance } from '@/apis/instance'; | ||
import { useQuery } from '@tanstack/react-query'; | ||
|
||
type IdProps = { | ||
resumeId: number; | ||
applyId: number; | ||
}; | ||
|
||
export const getProfileInfo = async ({ resumeId, applyId }: IdProps) => { | ||
const response = await clientInstance.get(getDynamicAPIPath.getApplicantProfile(resumeId, applyId)); | ||
return response.data; | ||
}; | ||
|
||
export const useGetProfileInfo = ({ resumeId, applyId }: IdProps) => | ||
useQuery({ | ||
queryKey: [getDynamicAPIPath.getApplicantProfile(resumeId, applyId)], | ||
queryFn: () => getProfileInfo({ resumeId, applyId }), | ||
}); |
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,18 @@ | ||
import { http, HttpResponse } from 'msw'; | ||
import { APIPath } from '@/apis/apiPath'; | ||
|
||
const mockData = { | ||
applicantName: 'μμΈλΉ', | ||
address: 'μΆ©λ¨λνκ΅', | ||
phoneNumber: '010-1111-1111', | ||
career: `μΉ΄νμμ 1λ μλ°νμ΅λλ€. ν΄λ½μμ 30λ 근무νμ΅λλ€.`, | ||
koreanLanguageLevel: 'κ³ κΈ', | ||
introduction: `맑μ μ 무μ νμ μ΅μ μ λ€νλ μΈμ¬μ λλ€. μλ νμΈμ©μλ νμΈμ©μλ νμΈμ©μλ νμΈμ©μλ νμΈμ©μλ νμΈμ©`, | ||
motivation: 'λ', | ||
}; | ||
|
||
export const getProfileInfoHandler = [ | ||
http.get(APIPath.getApplicantProfile, () => { | ||
return HttpResponse.json(mockData); | ||
}), | ||
]; |
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
60 changes: 60 additions & 0 deletions
60
src/pages/applicantsPage/ApplicantList/ApplicantProfile.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,60 @@ | ||
import { useGetProfileInfo } from '@/apis/applicants/hooks/useGetProfileInfo'; | ||
import { Flex, Typo } from '@/components/common'; | ||
import styled from '@emotion/styled'; | ||
import { Spinner } from '@/components/common'; | ||
|
||
type ProfileInfoProps = { | ||
title: string; | ||
content: string; | ||
}; | ||
function ProfileInfo({ title, content }: ProfileInfoProps) { | ||
return ( | ||
<> | ||
<Flex> | ||
<Flex direction="column" gap={{ y: '20px' }}> | ||
<Typo bold={true}>{title}</Typo> | ||
<Typo>{content}</Typo> | ||
</Flex> | ||
</Flex> | ||
<Divider /> | ||
</> | ||
); | ||
} | ||
|
||
export default function ApplicantProfile({ resumeId, applyId }: { resumeId: number; applyId: number }) { | ||
const { data, isLoading } = useGetProfileInfo({ resumeId, applyId }); | ||
|
||
if (isLoading) { | ||
return <Spinner />; | ||
} | ||
return ( | ||
<Flex css={{ padding: '10px', width: '100%' }} direction="column"> | ||
<Typo bold={true} size="18px"> | ||
{data.applicantName}λμ μ§μμμ λλ€. | ||
</Typo> | ||
<Flex gap={{ x: '10px' }} css={{ marginTop: '20px' }}> | ||
<Flex direction="column" gap={{ y: '5px' }} css={{ flex: 2 }}> | ||
<Typo>μ°λ½μ²</Typo> | ||
<Typo>μ£Όμ</Typo> | ||
</Flex> | ||
<Flex direction="column" gap={{ y: '5px' }} css={{ flex: 8 }}> | ||
<Typo>{data.phoneNumber}</Typo> | ||
<Typo>{data.address}</Typo> | ||
</Flex> | ||
</Flex> | ||
<Divider /> | ||
<ProfileInfo title="νκ΅μ΄ μ€λ ₯" content={data.koreanLanguageLevel} /> | ||
<ProfileInfo title="κ²½λ ₯" content={data.career} /> | ||
<ProfileInfo title="μκΈ°μκ°μ" content={data.introduction} /> | ||
<ProfileInfo title="μ§μλκΈ°" content={data.motivation} /> | ||
</Flex> | ||
); | ||
} | ||
|
||
const Divider = styled.div` | ||
width: 100%; | ||
height: 1px; | ||
opacity: 0.7; | ||
margin: 20px 0; | ||
background-color: #e9e9e9; | ||
`; |
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