From 03313f225e12609ef6af77325ca6f27ba4b6242c Mon Sep 17 00:00:00 2001 From: KimJi-An Date: Thu, 7 Nov 2024 00:51:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Header=20=EB=B2=88=EC=97=AD=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/translator/Header/headerData.ts | 14 ++++++++++++++ src/assets/translator/index.ts | 3 +++ src/features/layout/Header/index.tsx | 8 +++++--- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 src/assets/translator/Header/headerData.ts diff --git a/src/assets/translator/Header/headerData.ts b/src/assets/translator/Header/headerData.ts new file mode 100644 index 0000000..be876df --- /dev/null +++ b/src/assets/translator/Header/headerData.ts @@ -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', + }, +}; diff --git a/src/assets/translator/index.ts b/src/assets/translator/index.ts index 08cb42c..85a2ff6 100644 --- a/src/assets/translator/index.ts +++ b/src/assets/translator/index.ts @@ -1,6 +1,7 @@ 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'; @@ -13,6 +14,7 @@ export const KO = { applicants: { ...applicantsData[Languages.KO] }, registerVisa: { ...registerVisaData[Languages.KO] }, contractModal: { ...contractModalData[Languages.KO] }, + header: { ...headerData[Languages.KO] }, }; export const VE = { @@ -22,4 +24,5 @@ export const VE = { applicants: { ...applicantsData[Languages.VE] }, registerVisa: { ...registerVisaData[Languages.VE] }, contractModal: { ...contractModalData[Languages.VE] }, + header: { ...headerData[Languages.VE] }, }; diff --git a/src/features/layout/Header/index.tsx b/src/features/layout/Header/index.tsx index 51310da..abd373d 100644 --- a/src/features/layout/Header/index.tsx +++ b/src/features/layout/Header/index.tsx @@ -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(() => { @@ -65,20 +67,20 @@ export default function Header() { {!user ? ( ) : ( <> {user.type === 'employer' && ( )} )}