From ca57562f111b37293e6c0dd23830f132200861e4 Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Sat, 9 Nov 2024 18:48:22 +0900 Subject: [PATCH 1/9] =?UTF-8?q?fix:=20=EA=B7=BC=EB=A1=9C=EA=B3=84=EC=95=BD?= =?UTF-8?q?=EC=84=9C=20salary=20=ED=83=80=EC=9E=85=20number=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/contract/hooks/usePostContract.tsx | 2 +- src/pages/contract/EmployerContract/EmployerContract.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/contract/hooks/usePostContract.tsx b/src/apis/contract/hooks/usePostContract.tsx index a828e56..e1c0337 100644 --- a/src/apis/contract/hooks/usePostContract.tsx +++ b/src/apis/contract/hooks/usePostContract.tsx @@ -3,7 +3,7 @@ import { clientInstance } from '@/apis/instance'; import { useMutation } from '@tanstack/react-query'; export type ContractRequestData = { - salary?: string; + salary?: number; workingHours?: string; dayOff?: string; annualPaidLeave?: string; diff --git a/src/pages/contract/EmployerContract/EmployerContract.tsx b/src/pages/contract/EmployerContract/EmployerContract.tsx index 21bf3cc..641b6a5 100644 --- a/src/pages/contract/EmployerContract/EmployerContract.tsx +++ b/src/pages/contract/EmployerContract/EmployerContract.tsx @@ -17,7 +17,7 @@ export default function EmployerContract() { const [showSignError, setShowSignError] = useState(false); const [inputs, setInputs] = useState({ - salary: '', + salary: 0, workingHours: '', dayOff: '', annualPaidLeave: '', From 5e4da0859ed012d4e272569f25c71798bc433e2b Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Sat, 9 Nov 2024 18:54:43 +0900 Subject: [PATCH 2/9] =?UTF-8?q?feat:=20=EA=B7=BC=EB=A1=9C=EC=9E=90=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=ED=91=9C=EC=8B=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/translator/EmployeeMyPage/employeeMyPageData.ts | 2 -- src/features/employee/myPage/EmployeeProfile.tsx | 5 ++--- src/pages/myPage/employee/EmployeeMyPage.tsx | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts b/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts index f3c6ad7..65a23f8 100644 --- a/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts +++ b/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts @@ -6,13 +6,11 @@ export const employeeMyPageData = { REGISTER_SIGN: '사인 등록', REGISTER_VISA: '외국인 번호 및 비자 발급 일자 등록', MYRECRUITLIST: '내가 지원한 공고', - GREETING: '구직자님 안녕하세요!', }, [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', - GREETING: 'Xin chào người tìm việc!', }, }; diff --git a/src/features/employee/myPage/EmployeeProfile.tsx b/src/features/employee/myPage/EmployeeProfile.tsx index 8d5cca7..ce3ed9f 100644 --- a/src/features/employee/myPage/EmployeeProfile.tsx +++ b/src/features/employee/myPage/EmployeeProfile.tsx @@ -1,11 +1,10 @@ import { Card, Image, Typo } from '@/components/common'; import styled from '@emotion/styled'; -import { useTranslation } from 'react-i18next'; export default function EmployeeProfile({ + name = '홍길동', profileImage = 'https://img.freepik.com/free-photo/user-profile-icon-front-side-with-white-background_187299-40010.jpg?t=st=1729752570~exp=1729756170~hmac=4313719023c412dd92883d97ce79956fadf541e11d8cc3a4ef05150f301f5e7f&w=740', }) { - const { t } = useTranslation(); return ( - {t('employeeMyPage.GREETING')} + {name} diff --git a/src/pages/myPage/employee/EmployeeMyPage.tsx b/src/pages/myPage/employee/EmployeeMyPage.tsx index 257f453..8875a1a 100644 --- a/src/pages/myPage/employee/EmployeeMyPage.tsx +++ b/src/pages/myPage/employee/EmployeeMyPage.tsx @@ -15,13 +15,14 @@ export default function EmployeeMyPage() { const { data: myRecruitList } = useGetMyApplication(); const navigate = useNavigate(); + const name = userLocalStorage.getUser()?.name; const profileImage = userLocalStorage.getUser()?.profileImage; return (
- + Date: Sun, 10 Nov 2024 00:21:52 +0900 Subject: [PATCH 3/9] =?UTF-8?q?refactor:=20=EB=82=B4=EA=B0=80=20=EC=A7=80?= =?UTF-8?q?=EC=9B=90=ED=95=9C=20=EA=B8=80=20=EB=B6=88=EB=9F=AC=EC=98=A4?= =?UTF-8?q?=EA=B8=B0=20mock=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/employee/mock/getMyApplication.mock.ts | 4 ++-- .../employee/mock/myApplicationList.mock.ts} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/{pages/myPage/employee/data/index.mock.ts => apis/employee/mock/myApplicationList.mock.ts} (95%) diff --git a/src/apis/employee/mock/getMyApplication.mock.ts b/src/apis/employee/mock/getMyApplication.mock.ts index b7ef811..a8f02eb 100644 --- a/src/apis/employee/mock/getMyApplication.mock.ts +++ b/src/apis/employee/mock/getMyApplication.mock.ts @@ -1,9 +1,9 @@ import { http, HttpResponse } from 'msw'; import { getMyApplicationPath } from '../hooks/useGetMyApplication'; -import { myRecruitList } from '@/pages/myPage/employee/data/index.mock'; +import { myApplicationList } from '@/apis/employee/mock/myApplicationList.mock'; export const EmployeePageMockHandler = [ http.get(getMyApplicationPath(), () => { - return HttpResponse.json(myRecruitList); + return HttpResponse.json(myApplicationList); }), ]; diff --git a/src/pages/myPage/employee/data/index.mock.ts b/src/apis/employee/mock/myApplicationList.mock.ts similarity index 95% rename from src/pages/myPage/employee/data/index.mock.ts rename to src/apis/employee/mock/myApplicationList.mock.ts index c907fe9..8cfca04 100644 --- a/src/pages/myPage/employee/data/index.mock.ts +++ b/src/apis/employee/mock/myApplicationList.mock.ts @@ -1,6 +1,6 @@ import { MyRecruitListProps } from '@/types'; -export const myRecruitList: MyRecruitListProps[] = [ +export const myApplicationList: MyRecruitListProps[] = [ { id: 1, image: From ec66c0544b5247e3405ae793719d0f5583c472da Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Sun, 10 Nov 2024 16:53:25 +0900 Subject: [PATCH 4/9] =?UTF-8?q?feat:=20=EC=9D=B4=EB=A0=A5=EC=84=9C/?= =?UTF-8?q?=EC=84=9C=EB=AA=85/=EB=B9=84=EC=9E=90=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EC=97=AC=EB=B6=80=EC=97=90=20=EB=94=B0=EB=9D=BC=20=EA=B7=BC?= =?UTF-8?q?=EB=A1=9C=EC=9E=90=20=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20UI=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../useRequiredFieldCheck.ts | 2 +- src/assets/icons/employeePage/bag.svg | 2 +- src/assets/icons/employeePage/card.svg | 2 +- src/assets/icons/employeePage/check.svg | 1 + src/assets/icons/employeePage/pen.svg | 2 +- .../EmployeeMyPage/employeeMyPageData.ts | 12 ++- src/components/common/Button/index.tsx | 4 +- src/components/common/Icon/EmployeePage.ts | 2 + src/features/employee/myPage/ButtonGroup.tsx | 74 +++++++++++++++++++ src/features/employee/myPage/CardButton.tsx | 25 ------- .../employee/myPage/EmployeeProfile.tsx | 14 ++-- .../employee/myPage/ProfileSection.tsx | 24 ++++++ src/pages/myPage/employee/EmployeeMyPage.tsx | 74 +++++++------------ 13 files changed, 149 insertions(+), 89 deletions(-) create mode 100644 src/assets/icons/employeePage/check.svg create mode 100644 src/features/employee/myPage/ButtonGroup.tsx delete mode 100644 src/features/employee/myPage/CardButton.tsx create mode 100644 src/features/employee/myPage/ProfileSection.tsx diff --git a/src/apis/recruitmentsDetail/useRequiredFieldCheck.ts b/src/apis/recruitmentsDetail/useRequiredFieldCheck.ts index 2a4ec7a..de149d0 100644 --- a/src/apis/recruitmentsDetail/useRequiredFieldCheck.ts +++ b/src/apis/recruitmentsDetail/useRequiredFieldCheck.ts @@ -8,7 +8,7 @@ const getRequiredFieldCheck = async () => { return res.data; }; -export const useGetRequiredFieldCheck = (recruitmentId: number) => +export const useGetRequiredFieldCheck = (recruitmentId?: number) => useQuery({ queryKey: ['RequiredFieldCheckProps', recruitmentId], queryFn: () => getRequiredFieldCheck(), diff --git a/src/assets/icons/employeePage/bag.svg b/src/assets/icons/employeePage/bag.svg index 8af5d8d..4034967 100644 --- a/src/assets/icons/employeePage/bag.svg +++ b/src/assets/icons/employeePage/bag.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/employeePage/card.svg b/src/assets/icons/employeePage/card.svg index 43a2d44..dbc343e 100644 --- a/src/assets/icons/employeePage/card.svg +++ b/src/assets/icons/employeePage/card.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/icons/employeePage/check.svg b/src/assets/icons/employeePage/check.svg new file mode 100644 index 0000000..7070e00 --- /dev/null +++ b/src/assets/icons/employeePage/check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/employeePage/pen.svg b/src/assets/icons/employeePage/pen.svg index 05eb8ee..158bc8b 100644 --- a/src/assets/icons/employeePage/pen.svg +++ b/src/assets/icons/employeePage/pen.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts b/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts index 65a23f8..5b64c36 100644 --- a/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts +++ b/src/assets/translator/EmployeeMyPage/employeeMyPageData.ts @@ -2,15 +2,21 @@ import { Languages } from '../Languages'; export const employeeMyPageData = { [Languages.KO]: { - REGISTER_RESUME: '이력서 등록하기', + REGISTER_RESUME: '이력서 등록', REGISTER_SIGN: '사인 등록', - REGISTER_VISA: '외국인 번호 및 비자 발급 일자 등록', + REGISTER_VISA: '외국인 번호 및 비자 등록', + UPDATE_RESUME: '이력서 수정', + UPDATE_SIGN: '사인 수정', + UPDATE_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', + REGISTER_VISA: 'Đăng ký số người nước ngoài và visa', + UPDATE_RESUME: 'Cập nhật hồ sơ', + UPDATE_SIGN: 'Cập nhật chữ ký', + UPDATE_VISA: 'Cập nhật số người nước ngoài và visa', MYRECRUITLIST: 'Công việc tôi đã ứng tuyển', }, }; diff --git a/src/components/common/Button/index.tsx b/src/components/common/Button/index.tsx index f05beb2..97b32ba 100644 --- a/src/components/common/Button/index.tsx +++ b/src/components/common/Button/index.tsx @@ -25,10 +25,10 @@ const Wrapper = styled.button( return { backgroundColor: '#fff', color: '#0A65CC', - border: '2px solid #0A65CC', + border: '3px solid #0a65cc', '&:hover': { - backgroundColor: '#0033cc', + backgroundColor: '#0a65cc', color: '#fff', }, }; diff --git a/src/components/common/Icon/EmployeePage.ts b/src/components/common/Icon/EmployeePage.ts index b5a3924..802238c 100644 --- a/src/components/common/Icon/EmployeePage.ts +++ b/src/components/common/Icon/EmployeePage.ts @@ -1,11 +1,13 @@ import Bag from '@assets/icons/employeePage/bag.svg?react'; import Pen from '@assets/icons/employeePage/pen.svg?react'; import Card from '@assets/icons/employeePage/card.svg?react'; +import Check from '@assets/icons/employeePage/check.svg?react'; const EmployeePage = { Bag, Pen, Card, + Check, }; export default EmployeePage; diff --git a/src/features/employee/myPage/ButtonGroup.tsx b/src/features/employee/myPage/ButtonGroup.tsx new file mode 100644 index 0000000..1712cf9 --- /dev/null +++ b/src/features/employee/myPage/ButtonGroup.tsx @@ -0,0 +1,74 @@ +import styled from '@emotion/styled'; +import { useNavigate } from 'react-router-dom'; +import ROUTE_PATH from '@/routes/path'; +import { Button, Icon, Typo } from '@/components/common'; +import { useTranslation } from 'react-i18next'; +import { RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; + +export default function ButtonGroup({ requiredFieldCheck }: { requiredFieldCheck: RequiredFieldCheckProps }) { + const { t } = useTranslation(); + const navigate = useNavigate(); + + const { resumeExistence, visaExistence, foreignerIdNumberExistence } = requiredFieldCheck; + + return ( + + { + navigate(ROUTE_PATH.RESUME); + }} + > + {resumeExistence ? t('employeeMyPage.UPDATE_RESUME') : t('employeeMyPage.REGISTER_RESUME')} + {resumeExistence ? : } + + { + navigate(ROUTE_PATH.REGISTERSIGN); + }} + > + {visaExistence ? t('employeeMyPage.UPDATE_SIGN') : t('employeeMyPage.REGISTER_SIGN')} + {visaExistence ? : } + + { + navigate(ROUTE_PATH.REGISTER_VISA); + }} + > + + {foreignerIdNumberExistence ? t('employeeMyPage.UPDATE_VISA') : t('employeeMyPage.REGISTER_VISA')} + + {foreignerIdNumberExistence ? : } + + + ); +} + +const ColumnSection = styled.div` + width: 100%; + display: flex; +`; + +const ActiveButton = styled(Button)` + width: 100%; + height: 60px; + display: flex; + justify-content: space-between; + padding: 10px 20px; + border-radius: 0; + border: 0; + color: #000; + transition: + background-color 0.3s, + background-image 0.3s; // 배경 색상과 이미지 애니메이션 + + &:hover { + * { + color: #fff; + } + } +`; diff --git a/src/features/employee/myPage/CardButton.tsx b/src/features/employee/myPage/CardButton.tsx deleted file mode 100644 index a5cac95..0000000 --- a/src/features/employee/myPage/CardButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { Button } from '@/components/common'; -import React, { ReactNode } from 'react'; - -type Props = { - design?: 'default' | 'outlined' | 'textbutton' | 'deactivate'; - children: ReactNode; -} & React.ButtonHTMLAttributes; - -export default function CardButton({ design, children, ...rest }: Props) { - return ( - - ); -} diff --git a/src/features/employee/myPage/EmployeeProfile.tsx b/src/features/employee/myPage/EmployeeProfile.tsx index ce3ed9f..26a0ea7 100644 --- a/src/features/employee/myPage/EmployeeProfile.tsx +++ b/src/features/employee/myPage/EmployeeProfile.tsx @@ -1,19 +1,19 @@ import { Card, Image, Typo } from '@/components/common'; +import { userLocalStorage } from '@/utils/storage'; import styled from '@emotion/styled'; -export default function EmployeeProfile({ - name = '홍길동', - profileImage = 'https://img.freepik.com/free-photo/user-profile-icon-front-side-with-white-background_187299-40010.jpg?t=st=1729752570~exp=1729756170~hmac=4313719023c412dd92883d97ce79956fadf541e11d8cc3a4ef05150f301f5e7f&w=740', -}) { +export default function EmployeeProfile() { + const name = userLocalStorage.getUser()?.name || ''; + const profileImage = userLocalStorage.getUser()?.profileImage || ''; + return ( + + + + ); +} + +const Wrapper = styled.div` + width: 100%; + direction: column; + align-items: center; + margin-bottom: 52px; + border: 3px solid #0a65cc; + box-shadow: + rgba(50, 50, 93, 0.25) 0px 6px 12px -2px, + rgba(0, 0, 0, 0.3) 0px 3px 7px -3px; +`; diff --git a/src/pages/myPage/employee/EmployeeMyPage.tsx b/src/pages/myPage/employee/EmployeeMyPage.tsx index 8875a1a..1d239e7 100644 --- a/src/pages/myPage/employee/EmployeeMyPage.tsx +++ b/src/pages/myPage/employee/EmployeeMyPage.tsx @@ -1,63 +1,39 @@ -import { Icon, InnerContainer, Typo } from '@/components/common'; +import { Flex, InnerContainer, Spinner, Typo } from '@/components/common'; import Layout from '@/features/layout'; import styled from '@emotion/styled'; import MyRecruitList from '../../../features/employee/myPage/MyRecruitList'; -import CardButton from '../../../features/employee/myPage/CardButton'; -import EmployeeProfile from '../../../features/employee/myPage/EmployeeProfile'; import { useGetMyApplication } from '@/apis/employee/hooks/useGetMyApplication'; -import { useNavigate } from 'react-router-dom'; -import ROUTE_PATH from '@/routes/path'; import { useTranslation } from 'react-i18next'; -import { userLocalStorage } from '@/utils/storage'; +import ProfileSection from '@/features/employee/myPage/ProfileSection'; +import { css } from '@emotion/react'; +import { useGetRequiredFieldCheck } from '@/apis/recruitmentsDetail/useRequiredFieldCheck'; +import { type RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; export default function EmployeeMyPage() { const { t } = useTranslation(); - const { data: myRecruitList } = useGetMyApplication(); - const navigate = useNavigate(); - - const name = userLocalStorage.getUser()?.name; - const profileImage = userLocalStorage.getUser()?.profileImage; + const { data: myRecruitList, isLoading } = useGetMyApplication(); + const { data: requiredFieldCheck } = useGetRequiredFieldCheck(); + const requiredFieldCheckData: RequiredFieldCheckProps = requiredFieldCheck || { + resumeExistence: false, + visaExistence: false, + foreignerIdNumberExistence: false, + }; return ( -
- - - { - navigate(ROUTE_PATH.RESUME); - }} - > - {t('employeeMyPage.REGISTER_RESUME')} - - - { - navigate(ROUTE_PATH.REGISTERSIGN); - }} - > - {t('employeeMyPage.REGISTER_SIGN')} - - - { - navigate(ROUTE_PATH.REGISTER_VISA); - }} - > - {t('employeeMyPage.REGISTER_VISA')} - - - -
+
{t('employeeMyPage.MYRECRUITLIST')} - {myRecruitList && } + {isLoading ? ( + + + + ) : ( + myRecruitList && + )}
@@ -71,8 +47,10 @@ const Section = styled.div` margin-bottom: 52px; `; -const ColumnSection = styled.div` - width: 100%; - display: flex; - justify-content: space-between; +const spinnerFlexStyle = css` + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; `; From 90cab9f7687059109d62c04db72cecf99868743a Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Mon, 11 Nov 2024 20:44:01 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20RequiredFieldCheck=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EC=97=90=20=EC=82=AC=EC=9D=B8=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=EC=97=AC=EB=B6=80=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EA=B7=BC?= =?UTF-8?q?=EB=A1=9C=EC=9E=90=20=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/employee/myPage/ButtonGroup.tsx | 25 +++++++++++++------ .../employee/myPage/ProfileSection.tsx | 5 ++-- src/pages/myPage/employee/EmployeeMyPage.tsx | 11 +------- src/pages/recruit/RecruitType.ts | 1 + 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/features/employee/myPage/ButtonGroup.tsx b/src/features/employee/myPage/ButtonGroup.tsx index 1712cf9..56ff9e5 100644 --- a/src/features/employee/myPage/ButtonGroup.tsx +++ b/src/features/employee/myPage/ButtonGroup.tsx @@ -3,13 +3,20 @@ import { useNavigate } from 'react-router-dom'; import ROUTE_PATH from '@/routes/path'; import { Button, Icon, Typo } from '@/components/common'; import { useTranslation } from 'react-i18next'; -import { RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; +import { useGetRequiredFieldCheck } from '@/apis/recruitmentsDetail/useRequiredFieldCheck'; +import { type RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; -export default function ButtonGroup({ requiredFieldCheck }: { requiredFieldCheck: RequiredFieldCheckProps }) { +export default function ButtonGroup() { const { t } = useTranslation(); const navigate = useNavigate(); - - const { resumeExistence, visaExistence, foreignerIdNumberExistence } = requiredFieldCheck; + const { data: requiredFieldCheck } = useGetRequiredFieldCheck(); + const { resumeExistence, visaExistence, foreignerIdNumberExistence, signExistence }: RequiredFieldCheckProps = + requiredFieldCheck || { + resumeExistence: false, + visaExistence: false, + foreignerIdNumberExistence: false, + signExistence: false, + }; return ( @@ -30,8 +37,8 @@ export default function ButtonGroup({ requiredFieldCheck }: { requiredFieldCheck navigate(ROUTE_PATH.REGISTERSIGN); }} > - {visaExistence ? t('employeeMyPage.UPDATE_SIGN') : t('employeeMyPage.REGISTER_SIGN')} - {visaExistence ? : } + {signExistence ? t('employeeMyPage.UPDATE_SIGN') : t('employeeMyPage.REGISTER_SIGN')} + {signExistence ? : } - {foreignerIdNumberExistence ? t('employeeMyPage.UPDATE_VISA') : t('employeeMyPage.REGISTER_VISA')} + {visaExistence && foreignerIdNumberExistence + ? t('employeeMyPage.UPDATE_VISA') + : t('employeeMyPage.REGISTER_VISA')} - {foreignerIdNumberExistence ? : } + {visaExistence && foreignerIdNumberExistence ? : } ); diff --git a/src/features/employee/myPage/ProfileSection.tsx b/src/features/employee/myPage/ProfileSection.tsx index 9ca46f4..f712d0e 100644 --- a/src/features/employee/myPage/ProfileSection.tsx +++ b/src/features/employee/myPage/ProfileSection.tsx @@ -1,13 +1,12 @@ import styled from '@emotion/styled'; import EmployeeProfile from './EmployeeProfile'; import ButtonGroup from './ButtonGroup'; -import { RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; -export default function ProfileSection({ requiredFieldCheck }: { requiredFieldCheck: RequiredFieldCheckProps }) { +export default function ProfileSection() { return ( - + ); } diff --git a/src/pages/myPage/employee/EmployeeMyPage.tsx b/src/pages/myPage/employee/EmployeeMyPage.tsx index 1d239e7..b487640 100644 --- a/src/pages/myPage/employee/EmployeeMyPage.tsx +++ b/src/pages/myPage/employee/EmployeeMyPage.tsx @@ -6,23 +6,14 @@ import { useGetMyApplication } from '@/apis/employee/hooks/useGetMyApplication'; import { useTranslation } from 'react-i18next'; import ProfileSection from '@/features/employee/myPage/ProfileSection'; import { css } from '@emotion/react'; -import { useGetRequiredFieldCheck } from '@/apis/recruitmentsDetail/useRequiredFieldCheck'; -import { type RequiredFieldCheckProps } from '@/pages/recruit/RecruitType'; - export default function EmployeeMyPage() { const { t } = useTranslation(); const { data: myRecruitList, isLoading } = useGetMyApplication(); - const { data: requiredFieldCheck } = useGetRequiredFieldCheck(); - const requiredFieldCheckData: RequiredFieldCheckProps = requiredFieldCheck || { - resumeExistence: false, - visaExistence: false, - foreignerIdNumberExistence: false, - }; return ( - +
{t('employeeMyPage.MYRECRUITLIST')} diff --git a/src/pages/recruit/RecruitType.ts b/src/pages/recruit/RecruitType.ts index 12214db..16d6554 100644 --- a/src/pages/recruit/RecruitType.ts +++ b/src/pages/recruit/RecruitType.ts @@ -37,4 +37,5 @@ export interface RequiredFieldCheckProps { resumeExistence: boolean; visaExistence: boolean; foreignerIdNumberExistence: boolean; + signExistence?: boolean; } From 0889f35a82b23724d36052545ce3a2df673e82e6 Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Mon, 11 Nov 2024 20:47:07 +0900 Subject: [PATCH 6/9] =?UTF-8?q?feat:=20Title=20=EA=B3=B5=ED=86=B5=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Title/index.stories.tsx | 17 +++++++++++++++++ src/components/common/Title/index.tsx | 15 +++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/components/common/Title/index.stories.tsx create mode 100644 src/components/common/Title/index.tsx diff --git a/src/components/common/Title/index.stories.tsx b/src/components/common/Title/index.stories.tsx new file mode 100644 index 0000000..3b3dbe6 --- /dev/null +++ b/src/components/common/Title/index.stories.tsx @@ -0,0 +1,17 @@ +import { Meta, StoryObj } from '@storybook/react'; +import Title from '.'; + +const meta: Meta = { + title: 'common/Title', + component: Title, + tags: ['autodocs'], + args: { + text: '스토리북', + }, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = {}; diff --git a/src/components/common/Title/index.tsx b/src/components/common/Title/index.tsx new file mode 100644 index 0000000..70fa991 --- /dev/null +++ b/src/components/common/Title/index.tsx @@ -0,0 +1,15 @@ +import Typo from '../Typo'; + +type Props = { + text: string; + size?: string; +}; + +export default function Title({ text, size }: Props) { + const fontSize = size ? size : '24px'; + return ( + + {text} + + ); +} From 83189dc3222f8b72facde2bb31fa8229ae1a3669 Mon Sep 17 00:00:00 2001 From: YIMSEBIN Date: Mon, 11 Nov 2024 21:14:00 +0900 Subject: [PATCH 7/9] =?UTF-8?q?feat:=20=EA=B5=AC=EC=9D=B8=EA=B8=80=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20API=20=EC=97=B0=EA=B2=B0=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=EB=B0=8F=20=EC=9C=A0=ED=9A=A8=EC=84=B1=EA=B2=80?= =?UTF-8?q?=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../translator/PostNotice/postNoticeData.ts | 2 + src/pages/postNotice/PostNotice.tsx | 79 +++++++++++++++++-- src/routes/path.ts | 4 +- src/types/index.d.ts | 3 +- 4 files changed, 77 insertions(+), 11 deletions(-) diff --git a/src/assets/translator/PostNotice/postNoticeData.ts b/src/assets/translator/PostNotice/postNoticeData.ts index f37519d..e47a097 100644 --- a/src/assets/translator/PostNotice/postNoticeData.ts +++ b/src/assets/translator/PostNotice/postNoticeData.ts @@ -3,6 +3,7 @@ import { Languages } from '../Languages'; export const postNoticeData = { [Languages.KO]: { TITLE: '구인 글 등록하기', + NOTICE_TITLE: '제목', COMPANY_NAME: '회사명', EMPLOYER_NAME: '담당자명', COMPANY_SCALE: '회사규모', @@ -20,6 +21,7 @@ export const postNoticeData = { }, [Languages.VE]: { TITLE: 'Đăng thông báo tuyển dụng', + NOTICE_TITLE: 'Tiêu đề', COMPANY_NAME: 'Tên công ty', EMPLOYER_NAME: 'Tên người phụ trách', COMPANY_SCALE: 'Quy mô công ty', diff --git a/src/pages/postNotice/PostNotice.tsx b/src/pages/postNotice/PostNotice.tsx index df27e8f..fb88e98 100644 --- a/src/pages/postNotice/PostNotice.tsx +++ b/src/pages/postNotice/PostNotice.tsx @@ -6,13 +6,13 @@ import { NoticeRequestData } from '@/types'; import styled from '@emotion/styled'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useParams } from 'react-router-dom'; const default_inputs: NoticeRequestData = { title: '', companyScale: '', area: '', - salary: '', + salary: 0, workDuration: '', workDays: '', workType: '', @@ -23,14 +23,17 @@ const default_inputs: NoticeRequestData = { preferredConditions: '', employerName: '', companyName: '', + companyId: 0, }; export default function PostNotice() { const { t } = useTranslation(); const mutation = usePostNotice(); const navigate = useNavigate(); + const { companyId: curCompanyId } = useParams(); const [inputs, setInputs] = useState({ ...default_inputs }); + const [errors, setErrors] = useState<{ [key: string]: string }>({}); const { title, @@ -51,19 +54,55 @@ export default function PostNotice() { const onChange = (e: React.ChangeEvent) => { const { value, name } = e.target; + + if (name === 'salary') { + if (!/^\d*$/.test(value)) { + setErrors({ + ...errors, + salary: '숫자로 입력해주세요.', + }); + return; + } + } + setInputs({ ...inputs, - [name]: value, + [name]: name === 'salary' ? Number(value) : value, + }); + setErrors({ + ...errors, + [name]: '', }); }; const handlePostNotice = () => { + const newErrors: { [key: string]: string } = {}; + + if (!title) newErrors.title = '구인글 제목을 입력해주세요.'; + if (!companyScale) newErrors.companyScale = '회사 규모를 입력해주세요.'; + if (!area) newErrors.area = '지역을 입력해주세요.'; + if (!salary) newErrors.salary = '급여를 입력해주세요.'; + if (!workDuration) newErrors.workDuration = '근무 기간을 입력해주세요.'; + if (!workDays) newErrors.workDays = '근무 요일을 입력해주세요.'; + if (!workType) newErrors.workType = '근무 형태를 입력해주세요.'; + if (!workHours) newErrors.workHours = '근무 시간을 입력해주세요.'; + if (!requestedCareer) newErrors.requestedCareer = '요구 경력을 입력해주세요.'; + if (!majorBusiness) newErrors.majorBusiness = '주요 사업 내용을 입력해주세요.'; + if (!eligibilityCriteria) newErrors.eligibilityCriteria = '자격 요건을 입력해주세요.'; + if (!preferredConditions) newErrors.preferredConditions = '우대 조건을 입력해주세요.'; + if (!employerName) newErrors.employerName = '고용주 이름을 입력해주세요.'; + if (!companyName) newErrors.companyName = '회사명을 입력해주세요.'; + + setErrors(newErrors); + if (Object.keys(newErrors).length > 0) return; + + inputs.companyId = Number(curCompanyId); + mutation.mutate(inputs, { onSuccess: () => { navigate(ROUTE_PATH.HOME); }, onError: () => { - // 이부분 에러처리 결정해야함. alert('값이 정상적으로 저장되지 않았습니다.'); }, }); @@ -75,17 +114,18 @@ export default function PostNotice() { - + {t('postNotice.TITLE')} + {errors.title && {errors.title}} + {errors.companyName && {errors.companyName}} + {errors.employerName && {errors.employerName}} + {errors.companyScale && {errors.companyScale}} + {errors.area && {errors.area}} + {errors.salary && {errors.salary}} + {errors.majorBusiness && {errors.majorBusiness}} + {errors.workDuration && {errors.workDuration}} + {errors.workDays && {errors.workDays}} + {errors.workHours && {errors.workHours}} + {errors.workType && {errors.workType}} + {errors.requestedCareer && {errors.requestedCareer}} + {errors.eligibilityCriteria && {errors.eligibilityCriteria}} + {errors.preferredConditions && {errors.preferredConditions}}