Skip to content

Commit

Permalink
Merge branch 'Weekly' into feat/#104
Browse files Browse the repository at this point in the history
  • Loading branch information
YIMSEBIN authored Nov 7, 2024
2 parents 4867571 + a7aa25d commit 46b6002
Show file tree
Hide file tree
Showing 25 changed files with 525 additions and 167 deletions.
15 changes: 15 additions & 0 deletions src/apis/contract/hooks/useGetContractImg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { getDynamicAPIPath } from '@/apis/apiPath';
import { clientInstance } from '@/apis/instance';
import { useQuery } from '@tanstack/react-query';

export const getContractImgPath = (applyId: number) => `${getDynamicAPIPath.downloadContract(applyId)}`;
const getContractImg = async (applyId: number) => {
const res = await clientInstance.get(getContractImgPath(applyId));
return res.data;
};

export const useGetContractImg = (applyId: number) =>
useQuery({
queryKey: [getContractImgPath],
queryFn: () => getContractImg(applyId),
});
20 changes: 2 additions & 18 deletions src/apis/postNotice/hooks/usePostNotice.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
import { APIPath } from '@/apis/apiPath';
import { clientInstance } from '@/apis/instance';
import { NoticeRequestData } from '@/types';
import { useMutation } from '@tanstack/react-query';

export type NoticeRequestData = {
title?: string;
companyScale?: string;
area?: string;
salary?: string;
workDuration?: string;
workDays?: string;
workType?: string;
workHours?: string;
requestedCareer?: string;
majorBusiness?: string;
eligibilityCriteria?: string;
preferredConditions?: string;
employerName?: string;
companyName?: string;
};

export const getPostNoticePath = () => `${APIPath.postNotice}`;

export const postNotice = async (req: NoticeRequestData) => {
const response = await clientInstance.post(getPostNoticePath(), req);
return response.data;
};

export const useFetchPostNotice = () =>
export const usePostNotice = () =>
useMutation({
mutationFn: postNotice,
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const postCompany = async (req: CompanyRequestData) => {
return response.data;
};

export const useFetchPostCompany = () =>
export const usePostCompany = () =>
useMutation({
mutationFn: postCompany,
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { http, HttpResponse } from 'msw';
import { getPostCompanyPath } from './useRegisterCompany';
import { getPostCompanyPath } from '../hooks/useRegisterCompany';

export const registerCompanyMockHandler = [
http.post(getPostCompanyPath(), async ({ request }) => {
Expand Down
35 changes: 35 additions & 0 deletions src/assets/translator/Contract/contractData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Languages } from '../Languages';

export const contractData = {
[Languages.KO]: {
CONTRACT: 'κ·Ό 둜 계 μ•½ μ„œ',
WORKING_PLACE: '1. 근무μž₯μ†Œ',
RESPONSIBILITIES: '2. μ—…λ¬΄λ‚΄μš©',
WORKING_HOURS: '3. 근둜일 및 κ·Όλ‘œμΌλ³„ κ·Όλ‘œμ‹œκ°„',
DAY_OFF: '4. 주휴일',
SALARY: '5. μž„κΈˆ',
ANNUAL_PAID_LEAVE: '6. μ—°μ°¨μœ κΈ‰νœ΄κ°€',
RULE: '7. μ·¨μ—…κ·œμΉ™',
SENTENCE1: 'μ‚¬μš©μžμ™€ κ·Όλ‘œμžλŠ” κ°μžκ°€ κ·Όλ‘œκ³„μ•½, μ·¨μ—…κ·œμΉ™, λ‹¨μ²΄ν˜‘μ•½μ„ 지킀고 μ„±μ‹€ν•˜κ²Œ μ΄ν–‰ν•˜μ—¬μ•Ό ν•œλ‹€.',
SENTENCE2: "이 κ³„μ•½μ—μ„œ μ •ν•˜μ§€ μ•Šμ€ 사항은 'κ·Όλ‘œκΈ°μ€€λ²•'μ—μ„œ μ •ν•˜λŠ” 바에 λ”°λ₯Έλ‹€.",
SIGN: 'μ„œλͺ…ν•˜κΈ°',
SUBMIT: 'μ œμΆœν•˜κΈ°',
ERROR: '* κ·Όλ‘œκ³„μ•½μ„œμ— μ„œλͺ…ν•΄μ£Όμ„Έμš”!',
},
[Languages.VE]: {
CONTRACT: 'Hợp Δ‘α»“ng lao Δ‘α»™ng',
WORKING_PLACE: '1. NΖ‘i lΓ m việc',
RESPONSIBILITIES: '2. Nα»™i dung cΓ΄ng việc',
WORKING_HOURS: '3. NgΓ y lΓ m việc vΓ  giờ lΓ m việc theo ngΓ y',
DAY_OFF: '4. NgΓ y nghỉ hΓ ng tuαΊ§n',
SALARY: '5. Tiền lưƑng',
ANNUAL_PAID_LEAVE: '6. Nghỉ phΓ©p cΓ³ lΖ°Ζ‘ng hΓ ng nΔƒm',
RULE: '7. Quy tαΊ―c lao Δ‘α»™ng',
SENTENCE1:
'Người sα»­ dα»₯ng lao Δ‘α»™ng vΓ  người lao Δ‘α»™ng cαΊ§n tuΓ’n thủ hợp Δ‘α»“ng lao Δ‘α»™ng, quy tαΊ―c lao Δ‘α»™ng vΓ  thỏa thuαΊ­n tαΊ­p thể mα»™t cΓ‘ch nghiΓͺm tΓΊc.',
SENTENCE2: 'CΓ‘c Δ‘iều khoαΊ£n khΓ΄ng được quy Δ‘α»‹nh trong hợp Δ‘α»“ng nΓ y sαΊ½ được Δ‘iều chỉnh theo "LuαΊ­t lao Δ‘α»™ng".',
SIGN: 'KΓ½ tΓͺn',
SUBMIT: 'Gα»­i Δ‘i',
ERROR: '* Vui lΓ²ng kΓ½ vΓ o hợp Δ‘α»“ng lao Δ‘α»™ng!',
},
};
16 changes: 16 additions & 0 deletions src/assets/translator/EmployeeMyPage/employeeMyPageData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Languages } from '../Languages';

export const employeeMyPageData = {
[Languages.KO]: {
REGISTER_RESUME: '이λ ₯μ„œ λ“±λ‘ν•˜κΈ°',
REGISTER_SIGN: '사인 등둝',
REGISTER_VISA: '외ꡭ인 번호 및 λΉ„μž λ°œκΈ‰ 일자 등둝',
MYRECRUITLIST: 'λ‚΄κ°€ μ§€μ›ν•œ 곡고',
},
[Languages.VE]: {
REGISTER_RESUME: 'Đăng kΓ½ hα»“ sΖ‘',
REGISTER_SIGN: 'Đăng kΓ½ chα»― kΓ½',
REGISTER_VISA: 'Đăng kΓ½ sα»‘ người nΖ°α»›c ngoΓ i vΓ  ngΓ y cαΊ₯p visa',
MYRECRUITLIST: 'CΓ΄ng việc tΓ΄i Δ‘Γ£ α»©ng tuyển',
},
};
7 changes: 0 additions & 7 deletions src/assets/translator/EmployeeMyPage/ko.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/assets/translator/EmployeeMyPage/ve.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/assets/translator/PostNotice/ko.ts

This file was deleted.

38 changes: 38 additions & 0 deletions src/assets/translator/PostNotice/postNoticeData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { Languages } from '../Languages';

export const postNoticeData = {
[Languages.KO]: {
TITLE: 'ꡬ인 κΈ€ λ“±λ‘ν•˜κΈ°',
COMPANY_NAME: 'νšŒμ‚¬λͺ…',
EMPLOYER_NAME: 'λ‹΄λ‹Ήμžλͺ…',
COMPANY_SCALE: 'νšŒμ‚¬κ·œλͺ¨',
AREA: '근무지 μ£Όμ†Œ',
SALARY: 'κΈ‰μ—¬',
MAJOR_BUSINESS: 'μ—…λ¬΄λ‚΄μš©',
WORKDURATION: '근무기간',
WORKDAYS: 'κ·Όλ¬΄μš”μΌ',
WORKHOURS: 'κ·Όλ¬΄μ‹œκ°„',
WORKTYPE: 'κ³ μš©ν˜•νƒœ',
REQUESTED_CAREER: '지원쑰건',
ELIGIBILITY_CRITERIA: 'λΉ„μžμ‘°κ±΄',
PREFERRED_CONDITIONS: 'μš°λŒ€μ‚¬ν•­',
SUBMIT: 'λ“±λ‘ν•˜κΈ°',
},
[Languages.VE]: {
TITLE: 'Đăng thΓ΄ng bΓ‘o tuyển dα»₯ng',
COMPANY_NAME: 'TΓͺn cΓ΄ng ty',
EMPLOYER_NAME: 'TΓͺn người phα»₯ trΓ‘ch',
COMPANY_SCALE: 'Quy mΓ΄ cΓ΄ng ty',
AREA: 'Địa chỉ lΓ m việc',
SALARY: 'LΖ°Ζ‘ng',
MAJOR_BUSINESS: 'Nα»™i dung cΓ΄ng việc',
WORKDURATION: 'Thời gian lΓ m việc',
WORKDAYS: 'NgΓ y lΓ m việc trong tuαΊ§n',
WORKHOURS: 'Giờ lΓ m việc',
WORKTYPE: 'Hình thức lao động',
REQUESTED_CAREER: 'YΓͺu cαΊ§u kinh nghiệm',
ELIGIBILITY_CRITERIA: 'Điều kiện về visa',
PREFERRED_CONDITIONS: 'Ζ―u tiΓͺn',
SUBMIT: 'Đăng kΓ½',
},
};
11 changes: 0 additions & 11 deletions src/assets/translator/PostNotice/ve.ts

This file was deleted.

9 changes: 0 additions & 9 deletions src/assets/translator/RegisterCompany/ko.ts

This file was deleted.

22 changes: 22 additions & 0 deletions src/assets/translator/RegisterCompany/registerCompanyData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Languages } from '../Languages';

export const registerCompanyData = {
[Languages.KO]: {
TITLE: 'νšŒμ‚¬ 등둝',
LOGOIMAGE: 'νšŒμ‚¬ 이미지 μ—…λ‘œλ“œ(선택)',
COMPANYNAME: 'νšŒμ‚¬λͺ…',
INDUSTRY_OCCUPATION: '업직쒅',
BRAND: 'λΈŒλžœλ“œ',
REVENUE_PERYEAR: 'μ—° 평균 λ§€μΆœμ•‘',
SUBMIT: 'λ“±λ‘ν•˜κΈ°',
},
[Languages.VE]: {
TITLE: 'Đăng kΓ½ cΓ΄ng ty',
LOGOIMAGE: 'TαΊ£i lΓͺn logo cΓ΄ng ty (tΓΉy chọn)',
COMPANYNAME: 'TΓͺn cΓ΄ng ty',
INDUSTRY_OCCUPATION: 'Ngành nghề',
BRAND: 'ThΖ°Ζ‘ng hiệu',
REVENUE_PERYEAR: 'Doanh thu hàng năm',
SUBMIT: 'Đăng kΓ½',
},
};
9 changes: 0 additions & 9 deletions src/assets/translator/RegisterCompany/ve.ts

This file was deleted.

12 changes: 12 additions & 0 deletions src/assets/translator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import { recruitData } from './Recruit/recruitData';
import { registerVisaData } from './RegisterVisa/registerVisaData';
import { resumeData } from './Resume/resumeData';
import { registerSignData } from './registerSign/registerSignData';
import { contractData } from './Contract/contractData';
import { employeeMyPageData } from './EmployeeMyPage/employeeMyPageData';
import { postNoticeData } from './PostNotice/postNoticeData';
import { registerCompanyData } from './RegisterCompany/registerCompanyData';

export const KO = {
resume: { ...resumeData[Languages.KO] },
Expand All @@ -25,6 +29,10 @@ export const KO = {
applyGuide: { ...applyGuideData[Languages.KO] },
apply: { ...applyData[Languages.KO] },
registerSign: { ...registerSignData[Languages.KO] },
contract: { ...contractData[Languages.KO] },
employeeMyPage: { ...employeeMyPageData[Languages.KO] },
postNotice: { ...postNoticeData[Languages.KO] },
registerCompany: { ...registerCompanyData[Languages.KO] },
};

export const VE = {
Expand All @@ -40,4 +48,8 @@ export const VE = {
applyGuide: { ...applyGuideData[Languages.VE] },
apply: { ...applyData[Languages.VE] },
registerSign: { ...registerSignData[Languages.VE] },
contract: { ...contractData[Languages.VE] },
employeeMyPage: { ...employeeMyPageData[Languages.VE] },
postNotice: { ...postNoticeData[Languages.VE] },
registerCompany: { ...registerCompanyData[Languages.VE] },
};
2 changes: 1 addition & 1 deletion src/components/common/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Wrapper = styled.button<Props>(
border: '2px solid #0A65CC',

'&:hover': {
backgroundColor: '#6992C0',
backgroundColor: '#0033cc',
color: '#fff',
},
};
Expand Down
5 changes: 3 additions & 2 deletions src/components/common/Input/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ import styled from '@emotion/styled';

interface Props extends InputHTMLAttributes<HTMLInputElement> {
label?: string;
labelStyle?: React.CSSProperties;
}

export default function Input({ label, ...rest }: Props) {
export default function Input({ label, labelStyle, ...rest }: Props) {
return (
<>
{label && <label>{label}</label>}
{label && <label style={{ ...labelStyle }}>{label}</label>}
<InputContainer {...rest} />
</>
);
Expand Down
7 changes: 1 addition & 6 deletions src/features/employee/myPage/EmployeeProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Card, Image, Typo, Button } from '@/components/common';
import { Card, Image, Typo } from '@/components/common';
import styled from '@emotion/styled';

export default function EmployeeProfile({
Expand Down Expand Up @@ -39,11 +39,6 @@ export default function EmployeeProfile({
</Typo>
</TextSection>
</ProfileSection>
<Button
style={{ width: '150px', height: '40px', backgroundColor: 'white', fontSize: '12px', padding: '10px 30px' }}
>
ν”„λ‘œν•„ μˆ˜μ •ν•˜κΈ°
</Button>
</Card>
);
}
Expand Down
21 changes: 20 additions & 1 deletion src/features/employee/myPage/MyRecruitCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from '@emotion/styled';
import { MyRecruitListProps, StateProps, TextProps } from '@/types';
import { useNavigate } from 'react-router-dom';
import ROUTE_PATH from '@/routes/path';
import { useGetContractImg } from '@/apis/contract/hooks/useGetContractImg';

type DesignProps = {
design: 'default' | 'outlined' | 'textbutton' | 'deactivate';
Expand All @@ -18,7 +19,7 @@ function getStateStyle(state: StateProps): DesignProps {
case 'Waiting':
return { design: 'outlined', text: 'μ§€μ›μ„œ 검토쀑' };
case 'Completed':
return { design: 'deactivate', text: 'μ±„μš© μ™„λ£Œ' };
return { design: 'outlined', text: 'κ·Όλ‘œκ³„μ•½μ„œ λ‹€μš΄λ‘œλ“œ' };
default:
return { design: 'deactivate' }; // μƒνƒœκ°€ μ •μ˜λ˜μ§€ μ•Šμ€ 경우
}
Expand All @@ -28,10 +29,26 @@ type Props = {
myRecruit: MyRecruitListProps;
};

type DownloadContractProps = {
imageUrl: string;
imageUrlV: string;
};

export default function MyRecruitCard({ myRecruit }: Props) {
const { image, title, area, state, applyId } = myRecruit;
const buttonStyle = getStateStyle(state);
const navigate = useNavigate();
// κ·Όλ‘œκ³„μ•½μ„œ 이미지 λ‹€μš΄λ‘œλ“œ
const downloadContract = () => {
const { data: imgURLs } = useGetContractImg(applyId);
const imgData: DownloadContractProps = imgURLs;
const link = document.createElement('a');
link.href = imgData.imageUrlV;
link.download = 'downloaded_image';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
};

return (
<Card
Expand Down Expand Up @@ -66,6 +83,8 @@ export default function MyRecruitCard({ myRecruit }: Props) {
onClick={() => {
if (state == 'LetsSign') {
navigate(ROUTE_PATH.CONTRACT.EMPLOYEE.replace(':applyId', applyId.toString()));
} else if (state == 'Completed') {
downloadContract();
}
}}
>
Expand Down
Loading

0 comments on commit 46b6002

Please sign in to comment.