Skip to content

Commit

Permalink
Merge pull request #105 from KimJi-An/refactor/#102
Browse files Browse the repository at this point in the history
Refactor/#102, #106 ๋ฒˆ์—ญ ๋ฐ์ดํ„ฐ ์ˆ˜์ • ๋ฐ ์ ์šฉ, ํšŒ์‚ฌ ๋“ฑ๋ก ๋ฒ„ํŠผ ์ถ”๊ฐ€
  • Loading branch information
tteokbokki-master authored Nov 7, 2024
2 parents 63b065a + 7ddde2e commit ccf02fd
Show file tree
Hide file tree
Showing 35 changed files with 539 additions and 382 deletions.
414 changes: 207 additions & 207 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Languages } from '../../Languages';

export const contractModalData = {
[Languages.KO]: {
title: '๊ณ ์šฉ์ฃผ๋‹˜๊ป˜ ๋“œ๋ฆฌ๋Š” ์ฃผ์˜์‚ฌํ•ญ',
warning: '๋ถˆ๋ฒ• ์ฒด๋ฅ˜์ž๋ฅผ ๊ณ ์šฉํ•  ์‹œ ์ตœ๋Œ€ 200๋งŒ์›์˜ ๋ฒ”์น™๊ธˆ์ด ๋ถ€๊ณผ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.',
applicant_info: '์ง€์›์ž ์ •๋ณด',
foreigner_number: '์™ธ๊ตญ์ธ ๋“ฑ๋ก ๋ฒˆํ˜ธ',
visa_generate_date: '๋น„์ž ๋ฐœ๊ธ‰ ์ผ์ž',
message: {
part1: '์ด ์ง€์›์ž์˜ ์ •๋ณด๋ฅผ ํ™œ์šฉํ•˜์—ฌ <0>Hi Korea</0>์—์„œ ์ง€์›์ž์— ๋Œ€ํ•œ ๋ถˆ๋ฒ• ์ฒด๋ฅ˜ ์—ฌ๋ถ€๋ฅผ ๊ฒ€์ฆํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.',
part2: '์•ˆ์ „ํ•œ ๊ณ ์šฉ์„ ์œ„ํ•ด ํ™•์ธ ํ›„ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ์„ ๊ถŒ์žฅํ•ฉ๋‹ˆ๋‹ค.',
},
buttons: {
confirm: 'ํ™•์ธํ•˜์˜€์Šต๋‹ˆ๋‹ค.',
cancel: '์ทจ์†Œ',
},
},
[Languages.VE]: {
title: 'Lแปi khuyรชn dร nh cho nhร  tuyแปƒn dแปฅng',
warning: 'Nแบฟu thuรช ngฦฐแปi lฦฐu trรบ bแบฅt hแปฃp phรกp, bแบกn cรณ thแปƒ bแป‹ phแบกt tแป‘i ฤ‘a 2 triแป‡u won.',
applicant_info: 'Thรดng tin แปฉng viรชn',
foreigner_number: 'Sแป‘ ฤ‘ฤƒng kรฝ ngฦฐแปi nฦฐแป›c ngoร i',
visa_generate_date: 'Ngร y cแบฅp visa',
message: {
part1:
'Bแบกn cรณ thแปƒ sแปญ dแปฅng thรดng tin cแปงa ngฦฐแปi nร y ฤ‘แปƒ kiแปƒm tra tรฌnh trแบกng cฦฐ trรบ bแบฅt hแปฃp phรกp tแบกi <0>Hi Korea</0>.',
part2: 'Chรบng tรดi khuyแบฟn nghแป‹ bแบกn kiแปƒm tra kแปน trฦฐแป›c khi tiแบฟn hร nh ฤ‘แปƒ ฤ‘แบฃm bแบฃo an toร n trong viแป‡c tuyแปƒn dแปฅng.',
},
buttons: {
confirm: 'Tรดi ฤ‘รฃ hiแปƒu',
cancel: 'Hแปงy bแป',
},
},
};
34 changes: 34 additions & 0 deletions src/assets/translator/Applicants/applicantsData.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Languages } from '../Languages';

export const applicantsData = {
[Languages.KO]: {
salary: '์‹œ๊ธ‰',
applicant_list: '์ง€์›์ž ๋ชฉ๋ก',
total_applicants: '์ด {{count}}๋ช…',
view_details: '์ž์„ธํžˆ ๋ณด๋Ÿฌ๊ฐ€๊ธฐ',
table_headers: {
name: '์ด๋ฆ„',
nation: '๊ตญ์ ',
korean_language_level: 'ํ•œ๊ตญ์–ด ์‹ค๋ ฅ',
},
buttons: {
view_resume: '์ง€์›์„œ',
create_contract: '๊ณ„์•ฝํ•˜๊ธฐ',
},
},
[Languages.VE]: {
salary: 'Lฦฐฦกng theo giแป',
applicant_list: 'Danh sรกch แปฉng viรชn',
total_applicants: 'Tแป•ng cแป™ng {{count}} ngฦฐแปi',
view_details: 'Xem chi tiแบฟt',
table_headers: {
name: 'Tรชn',
nation: 'Quแป‘c tแป‹ch',
korean_language_level: 'Trรฌnh ฤ‘แป™ tiแบฟng Hร n',
},
buttons: {
view_resume: 'Hแป“ sฦก แปฉng tuyแปƒn',
create_contract: 'Kรฝ hแปฃp ฤ‘แป“ng',
},
},
};
14 changes: 0 additions & 14 deletions src/assets/translator/Applicants/ko.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/assets/translator/Applicants/ve.ts

This file was deleted.

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

export const employerMyPageData = {
[Languages.KO]: {
greeting: '์‚ฌ์žฅ๋‹˜, ์•ˆ๋…•ํ•˜์„ธ์š”!',
register_company: 'ํšŒ์‚ฌ ๋“ฑ๋ก',
register_sign: '์‚ฌ์ธ ๋“ฑ๋ก',
my_companies: '๋‚ด ํšŒ์‚ฌ',
total_companies: '์ด {{count}} ๊ณณ',
company_info: 'ํšŒ์‚ฌ ์ •๋ณด',
},
[Languages.VE]: {
greeting: 'Chแปง doanh nghiแป‡p, xin chร o!',
register_company: 'ฤฤƒng kรฝ cรดng ty',
register_sign: 'ฤฤƒng kรฝ chแปฏ kรฝ',
my_companies: 'Cรดng ty cแปงa tรดi',
total_companies: 'Tแป•ng cแป™ng {{count}} cรดng ty',
company_info: 'Thรดng tin cรดng ty',
},
};
7 changes: 0 additions & 7 deletions src/assets/translator/EmployerMyPage/ko.ts

This file was deleted.

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

This file was deleted.

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

export const headerData = {
[Languages.KO]: {
post_notice: '์ฑ„์šฉ๊ณต๊ณ  ๋“ฑ๋ก',
login: '๋กœ๊ทธ์ธ',
logout: '๋กœ๊ทธ์•„์›ƒ',
},
[Languages.VE]: {
post_notice: 'ฤฤƒng thรดng bรกo tuyแปƒn dแปฅng',
login: 'ฤฤƒng nhแบญp',
logout: 'ฤฤƒng xuแบฅt',
},
};
13 changes: 0 additions & 13 deletions src/assets/translator/MyCompany/ko.ts

This file was deleted.

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

export const myCompanyData = {
[Languages.KO]: {
my_recruitments: '๋‚ด ๊ณต๊ณ ๊ธ€',
total_recruitments: '์ด {{count}}๊ฑด',
table_headers: {
location: '๊ทผ๋ฌด์ง€',
title: '๊ณต๊ณ  ์ œ๋ชฉ',
},
buttons: {
view_applicants: '์ง€์›์ž ๋ณด๋Ÿฌ๊ฐ€๊ธฐ',
close_recruitment: '๋งˆ๊ฐํ•˜๊ธฐ',
closed_recruitment: '๋งˆ๊ฐ์™„๋ฃŒ',
},
},
[Languages.VE]: {
my_recruitments: 'Thรดng bรกo tuyแปƒn dแปฅng cแปงa tรดi',
total_recruitments: 'Tแป•ng cแป™ng {{count}} bร i',
table_headers: {
location: 'Nฦกi lร m viแป‡c',
title: 'Tiรชu ฤ‘แป thรดng bรกo',
},
buttons: {
view_applicants: 'Xem ngฦฐแปi แปฉng tuyแปƒn',
close_recruitment: 'ฤรณng tuyแปƒn dแปฅng',
closed_recruitment: 'ฤรฃ ฤ‘รณng tuyแปƒn dแปฅng',
},
},
};
13 changes: 0 additions & 13 deletions src/assets/translator/MyCompany/ve.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/assets/translator/RegisterVisa/ko.ts

This file was deleted.

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

export const registerVisaData = {
[Languages.KO]: {
title: '์™ธ๊ตญ์ธ ๋ฒˆํ˜ธ ๋ฐ ๋น„์ž ๋ฐœ๊ธ‰ ์ผ์ž ๋“ฑ๋ก',
labels: {
foreigner_number: '์™ธ๊ตญ์ธ ๋ฒˆํ˜ธ',
visa_generate_date: '๋น„์ž ๋ฐœ๊ธ‰ ์ผ์ž',
},
error_message: '์˜ฌ๋ฐ”๋ฅธ ํ˜•์‹์œผ๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”. (ํ˜•์‹: 000000-0000000)',
submit: '๋“ฑ๋กํ•˜๊ธฐ',
complete_message: '๋“ฑ๋ก์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.',
button: 'ํ™•์ธ',
},
[Languages.VE]: {
title: 'ฤฤƒng kรฝ sแป‘ ngฦฐแปi nฦฐแป›c ngoร i vร  ngร y cแบฅp thแป‹ thแปฑc',
labels: {
foreigner_number: 'Sแป‘ ngฦฐแปi nฦฐแป›c ngoร i',
visa_generate_date: 'Ngร y cแบฅp thแป‹ thแปฑc',
},
error_message: 'Vui lรฒng nhแบญp ฤ‘รบng ฤ‘แป‹nh dแบกng. (ฤ‘แป‹nh dแบกng: 000000-0000000)',
submit: 'ฤฤƒng kรฝ',
complete_message: 'ฤฤƒng kรฝ ฤ‘รฃ hoร n tแบฅt.',
button: 'Xรกc nhแบญn',
},
};
8 changes: 0 additions & 8 deletions src/assets/translator/RegisterVisa/ve.ts

This file was deleted.

26 changes: 24 additions & 2 deletions src/assets/translator/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
import { applicantsData } from './Applicants/applicantsData';
import { contractModalData } from './Applicants/ContractModal/contractModalData';
import { employerMyPageData } from './EmployerMyPage/employerMyPageData';
import { headerData } from './Header/headerData';
import { Languages } from './Languages';
import { myCompanyData } from './MyCompany/myCompanyData';
import { registerVisaData } from './RegisterVisa/registerVisaData';
import { resumeData } from './Resume/resumeData';

export const KO = { resume: { ...resumeData[Languages.KO] } };
export const KO = {
resume: { ...resumeData[Languages.KO] },
employerMyPage: { ...employerMyPageData[Languages.KO] },
myCompany: { ...myCompanyData[Languages.KO] },
applicants: { ...applicantsData[Languages.KO] },
registerVisa: { ...registerVisaData[Languages.KO] },
contractModal: { ...contractModalData[Languages.KO] },
header: { ...headerData[Languages.KO] },
};

export const VE = { resume: { ...resumeData[Languages.VE] } };
export const VE = {
resume: { ...resumeData[Languages.VE] },
employerMyPage: { ...employerMyPageData[Languages.VE] },
myCompany: { ...myCompanyData[Languages.VE] },
applicants: { ...applicantsData[Languages.VE] },
registerVisa: { ...registerVisaData[Languages.VE] },
contractModal: { ...contractModalData[Languages.VE] },
header: { ...headerData[Languages.VE] },
};
3 changes: 2 additions & 1 deletion src/features/layout/Header/index.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ export const Nav = styled.nav<NavProps>`
${responsiveStyle({
tablet: {
width: '100%',
width: '80%',
justifyContent: 'center',
marginTop: '10px',
},
mobile: {
width: '100%',
flexDirection: 'column',
alignItems: 'stretch',
textAlign: 'center',
Expand Down
8 changes: 5 additions & 3 deletions src/features/layout/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ import { useNavigate } from 'react-router-dom';
import ROUTE_PATH from '@/routes/path';
import { useUser } from '@/components/providers/User.provider';
import { userLocalStorage } from '@/utils/storage';
import { useTranslation } from 'react-i18next';

export default function Header() {
const navigate = useNavigate();
const [menuOpen, toggleMenu] = useToggle();
const { user, setUser } = useUser();
const { t } = useTranslation();

const goToHome = () => {
startTransition(() => {
Expand Down Expand Up @@ -65,20 +67,20 @@ export default function Header() {
<LanguageFilter />
{!user ? (
<Button style={customButtonStyle} onClick={login}>
๋กœ๊ทธ์ธ
{t('header.login')}
</Button>
) : (
<>
{user.type === 'employer' && (
<Button design="outlined" style={commonButtonStyle} onClick={goToPostNotice}>
์ฑ„์šฉ๊ณต๊ณ  ๋“ฑ๋ก
{t('header.post_notice')}
</Button>
)}
<Flex justifyContent="center" alignItems="center" onClick={goToMyPage}>
<Image url={user.profileImage} size={{ width: '40px', height: '40px' }} css={imageStyle} />
</Flex>
<Button style={customButtonStyle} onClick={logout}>
๋กœ๊ทธ์•„์›ƒ
{t('header.logout')}
</Button>
</>
)}
Expand Down
14 changes: 8 additions & 6 deletions src/features/registerVisa/VisaRegistrationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ChangeEvent, useMemo, useState } from 'react';
import { useRegisterVisaInfo } from '@/apis/applicants/hooks/useRegisterVisaInfo';
import { buttonStyle, ErrorMessage, Form, inputStyle } from './VisaRegistrationForm.styles';
import { validateForeignerNumber } from './validateForeignerNumber';
import { useTranslation } from 'react-i18next';

export default function VisaRegistrationForm() {
const [foreignerIdNumber, setForeignerNumber] = useState('');
Expand All @@ -12,11 +13,12 @@ export default function VisaRegistrationForm() {
const formValid = useMemo(() => !error, [error]);

const registerVisaMutation = useRegisterVisaInfo();
const { t } = useTranslation();

const handleForeignerNumberChange = (e: ChangeEvent<HTMLInputElement>) => {
const { value } = e.target;
if (!validateForeignerNumber(value) && value !== '') {
setError('์˜ฌ๋ฐ”๋ฅธ ํ˜•์‹์œผ๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”. (ํ˜•์‹: 000000-0000000)');
setError(t('registerVisa.error_message'));
} else {
setError('');
}
Expand Down Expand Up @@ -49,7 +51,7 @@ export default function VisaRegistrationForm() {
<Form onSubmit={handleSubmit}>
<Flex direction="column" gap={{ y: '10px' }}>
<Input
label="์™ธ๊ตญ์ธ ๋ฒˆํ˜ธ"
label={t('registerVisa.labels.foreigner_number')}
type="text"
value={foreignerIdNumber}
onChange={handleForeignerNumberChange}
Expand All @@ -60,7 +62,7 @@ export default function VisaRegistrationForm() {
</Flex>
<Flex direction="column" gap={{ y: '10px' }}>
<Input
label="๋น„์ž ๋ฐœ๊ธ‰ ์ผ์ž"
label={t('registerVisa.labels.visa_generate_date')}
type="date"
value={visaGenerateDate}
onChange={(e) => setVisaGenerateDate(e.target.value)}
Expand All @@ -70,14 +72,14 @@ export default function VisaRegistrationForm() {
</Flex>
<Flex justifyContent="center">
<Button type="submit" css={buttonStyle} disabled={!formValid}>
๋“ฑ๋กํ•˜๊ธฐ
{t('registerVisa.submit')}
</Button>
</Flex>
</Form>
{isModalOpen && (
<Modal
textChildren="๋“ฑ๋ก์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค."
buttonChildren={<Button onClick={closeModal}>ํ™•์ธ</Button>}
textChildren={t('registerVisa.complete_message')}
buttonChildren={<Button onClick={closeModal}>{t('registerVisa.button')}</Button>}
onClose={closeModal}
/>
)}
Expand Down
Loading

0 comments on commit ccf02fd

Please sign in to comment.