Skip to content

Commit

Permalink
Merge pull request #129 from YIMSEBIN/Weekly
Browse files Browse the repository at this point in the history
Feat/#128 ๊ทผ๋กœ์ž๋งˆ์ดํŽ˜์ด์ง€ ์ˆ˜์ •, ์œ ํšจ์„ฑ๊ฒ€์‚ฌ ๋ฐ ๊ตฌ์ธ๊ธ€๋“ฑ๋ก API ์™„๋ฃŒ
  • Loading branch information
YIMSEBIN authored Nov 11, 2024
2 parents e51924e + 91517b3 commit 8f533c7
Show file tree
Hide file tree
Showing 25 changed files with 401 additions and 163 deletions.
2 changes: 1 addition & 1 deletion src/apis/contract/hooks/usePostContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/apis/employee/mock/getMyApplication.mock.ts
Original file line number Diff line number Diff line change
@@ -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);
}),
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MyRecruitListProps } from '@/types';

export const myRecruitList: MyRecruitListProps[] = [
export const myApplicationList: MyRecruitListProps[] = [
{
id: 1,
image:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/icons/employeePage/bag.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/employeePage/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/icons/employeePage/check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/employeePage/pen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions src/assets/translator/EmployeeMyPage/employeeMyPageData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +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: '๋‚ด๊ฐ€ ์ง€์›ํ•œ ๊ณต๊ณ ',
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',
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',
GREETING: 'Xin chร o ngฦฐแปi tรฌm viแป‡c!',
},
};
2 changes: 2 additions & 0 deletions src/assets/translator/PostNotice/postNoticeData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Languages } from '../Languages';
export const postNoticeData = {
[Languages.KO]: {
TITLE: '๊ตฌ์ธ ๊ธ€ ๋“ฑ๋กํ•˜๊ธฐ',
NOTICE_TITLE: '์ œ๋ชฉ',
COMPANY_NAME: 'ํšŒ์‚ฌ๋ช…',
EMPLOYER_NAME: '๋‹ด๋‹น์ž๋ช…',
COMPANY_SCALE: 'ํšŒ์‚ฌ๊ทœ๋ชจ',
Expand All @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const Wrapper = styled.button<Props>(
return {
backgroundColor: '#fff',
color: '#0A65CC',
border: '2px solid #0A65CC',
border: '3px solid #0a65cc',

'&:hover': {
backgroundColor: '#0033cc',
backgroundColor: '#0a65cc',
color: '#fff',
},
};
Expand Down
2 changes: 2 additions & 0 deletions src/components/common/Icon/EmployeePage.ts
Original file line number Diff line number Diff line change
@@ -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;
17 changes: 17 additions & 0 deletions src/components/common/Title/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Meta, StoryObj } from '@storybook/react';
import Title from '.';

const meta: Meta<typeof Title> = {
title: 'common/Title',
component: Title,
tags: ['autodocs'],
args: {
text: '์Šคํ† ๋ฆฌ๋ถ',
},
};

export default meta;

type Story = StoryObj<typeof Title>;

export const Default: Story = {};
15 changes: 15 additions & 0 deletions src/components/common/Title/index.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<Typo element="h1" size={fontSize} style={{ fontWeight: 'bold', marginBottom: '24px' }}>
{text}
</Typo>
);
}
83 changes: 83 additions & 0 deletions src/features/employee/myPage/ButtonGroup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
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 { useGetRequiredFieldCheck } from '@/apis/recruitmentsDetail/useRequiredFieldCheck';
import { type RequiredFieldCheckProps } from '@/pages/recruit/RecruitType';

export default function ButtonGroup() {
const { t } = useTranslation();
const navigate = useNavigate();
const { data: requiredFieldCheck } = useGetRequiredFieldCheck();
const { resumeExistence, visaExistence, foreignerIdNumberExistence, signExistence }: RequiredFieldCheckProps =
requiredFieldCheck || {
resumeExistence: false,
visaExistence: false,
foreignerIdNumberExistence: false,
signExistence: false,
};

return (
<ColumnSection>
<ActiveButton
design="outlined"
style={{ borderRight: '3px solid #0a65cc' }}
onClick={() => {
navigate(ROUTE_PATH.RESUME);
}}
>
<Typo bold>{resumeExistence ? t('employeeMyPage.UPDATE_RESUME') : t('employeeMyPage.REGISTER_RESUME')}</Typo>
{resumeExistence ? <Icon.EmployeePage.Check /> : <Icon.EmployeePage.Bag />}
</ActiveButton>
<ActiveButton
design="outlined"
style={{ borderRight: '3px solid #0a65cc' }}
onClick={() => {
navigate(ROUTE_PATH.REGISTERSIGN);
}}
>
<Typo bold>{signExistence ? t('employeeMyPage.UPDATE_SIGN') : t('employeeMyPage.REGISTER_SIGN')}</Typo>
{signExistence ? <Icon.EmployeePage.Check /> : <Icon.EmployeePage.Pen />}
</ActiveButton>
<ActiveButton
design="outlined"
onClick={() => {
navigate(ROUTE_PATH.REGISTER_VISA);
}}
>
<Typo bold>
{visaExistence && foreignerIdNumberExistence
? t('employeeMyPage.UPDATE_VISA')
: t('employeeMyPage.REGISTER_VISA')}
</Typo>
{visaExistence && foreignerIdNumberExistence ? <Icon.EmployeePage.Check /> : <Icon.EmployeePage.Card />}
</ActiveButton>
</ColumnSection>
);
}

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;
}
}
`;
25 changes: 0 additions & 25 deletions src/features/employee/myPage/CardButton.tsx

This file was deleted.

17 changes: 8 additions & 9 deletions src/features/employee/myPage/EmployeeProfile.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { Card, Image, Typo } from '@/components/common';
import { userLocalStorage } from '@/utils/storage';
import styled from '@emotion/styled';
import { useTranslation } from 'react-i18next';

export default function EmployeeProfile({
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();
export default function EmployeeProfile() {
const name = userLocalStorage.getUser()?.name || '';
const profileImage = userLocalStorage.getUser()?.profileImage || '';

return (
<Card
style={{
width: '100%',
height: '100px',
border: 0,
borderRadius: '4px',
marginBottom: '24px',
padding: '10px 30px',
borderRadius: 0,
padding: '0 30px',
backgroundColor: '#0A65CC',
display: 'flex',
justifyContent: 'space-between',
Expand All @@ -32,7 +31,7 @@ export default function EmployeeProfile({
/>
<TextSection>
<Typo bold color="white" size="20px">
{t('employeeMyPage.GREETING')}
{name}
</Typo>
</TextSection>
</ProfileSection>
Expand Down
23 changes: 23 additions & 0 deletions src/features/employee/myPage/ProfileSection.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styled from '@emotion/styled';
import EmployeeProfile from './EmployeeProfile';
import ButtonGroup from './ButtonGroup';

export default function ProfileSection() {
return (
<Wrapper>
<EmployeeProfile />
<ButtonGroup />
</Wrapper>
);
}

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;
`;
5 changes: 4 additions & 1 deletion src/pages/contract/EmployeeContract/EmployeeContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,11 @@ export default function EmployeeContract() {
const LineWrapper = styled.div`
border: 1px solid #e9e9e9;
border-radius: 3px;
padding: 100px 200px;
padding: 100px 100px;
margin: 52px 0;
box-shadow:
rgba(50, 50, 93, 0.25) 0px 6px 12px -2px,
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
`;

const InputWrapper = styled.div`
Expand Down
7 changes: 5 additions & 2 deletions src/pages/contract/EmployerContract/EmployerContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function EmployerContract() {
const [showSignError, setShowSignError] = useState(false);

const [inputs, setInputs] = useState({
salary: '',
salary: 0,
workingHours: '',
dayOff: '',
annualPaidLeave: '',
Expand Down Expand Up @@ -158,8 +158,11 @@ export default function EmployerContract() {
const LineWrapper = styled.div`
border: 1px solid #e9e9e9;
border-radius: 3px;
padding: 100px 200px;
padding: 100px 100px;
margin: 52px 0;
box-shadow:
rgba(50, 50, 93, 0.25) 0px 6px 12px -2px,
rgba(0, 0, 0, 0.3) 0px 3px 7px -3px;
`;

const InputWrapper = styled.div`
Expand Down
Loading

0 comments on commit 8f533c7

Please sign in to comment.