Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/Weekly' into Weekly-11
Browse files Browse the repository at this point in the history
  • Loading branch information
KimJi-An committed Nov 11, 2024
2 parents a51dcbc + 9cb30b9 commit 9797ff9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 49 deletions.
4 changes: 2 additions & 2 deletions src/apis/recruitmentsDetail/useRequiredFieldCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ const getRequiredFieldCheck = async () => {
return res.data;
};

export const useGetRequiredFieldCheck = (recruitmentId: number) =>
export const useGetRequiredFieldCheck = () =>
useQuery<RequiredFieldCheckProps, Error>({
queryKey: ['RequiredFieldCheckProps', recruitmentId],
queryKey: ['RequiredFieldCheckProps'],
queryFn: () => getRequiredFieldCheck(),
});
26 changes: 9 additions & 17 deletions src/pages/recruit/RecruitDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { type SectionProps, type RecruitDetailProps } from './RecruitType';
import styled from '@emotion/styled';
import { Flex } from '@/components/common';
import { useTranslation } from 'react-i18next';
import { userLocalStorage } from '@/utils/storage';

const SectionWithTitle = ({ title, children }: SectionProps) => (
<Section>
Expand All @@ -24,7 +25,6 @@ const SectionConditions = ({ title, children }: SectionProps) => (
);

export default function RecruitDetail({
detailedDescription,
majorBusiness,
eligibilityCriteria,
preferredConditions,
Expand All @@ -35,8 +35,11 @@ export default function RecruitDetail({
workType,
workHours,
salary,
koreanDetailedDescription,
vietnameseDetailedDescription,
}: RecruitDetailProps) {
const { t } = useTranslation();
const language = userLocalStorage.getLanguage();
return (
<RecruitDetailContainer>
<SectionWithTitle title={t('recruit.conditions')}>
Expand Down Expand Up @@ -68,23 +71,12 @@ export default function RecruitDetail({
</Flex>
</Flex>
</SectionWithTitle>
<SectionWithTitle title={t('recruit.eligibilityRequirements')}>
{eligibilityCriteria?.map((data) => {
return <li key={data.id}>{data.text}</li>;
})}
</SectionWithTitle>
<SectionWithTitle title={t('recruit.detailedDescription')}>{detailedDescription}</SectionWithTitle>
<SectionWithTitle title={t('recruit.mainResponsibilities')}>
{majorBusiness?.map((data) => {
return <li key={data.id}>{data.text}</li>;
})}
</SectionWithTitle>

<SectionWithTitle title={t('recruit.PreferredRequirements')}>
{preferredConditions?.map((data) => {
return <li key={data.id}>{data.text}</li>;
})}
<SectionWithTitle title={t('recruit.eligibilityRequirements')}>{eligibilityCriteria}</SectionWithTitle>
<SectionWithTitle title={t('recruit.detailedDescription')}>
{language && language === 'ko' ? koreanDetailedDescription : vietnameseDetailedDescription}
</SectionWithTitle>
<SectionWithTitle title={t('recruit.mainResponsibilities')}>{majorBusiness}</SectionWithTitle>
<SectionWithTitle title={t('recruit.PreferredRequirements')}>{preferredConditions}</SectionWithTitle>
</RecruitDetailContainer>
);
}
Expand Down
12 changes: 3 additions & 9 deletions src/pages/recruit/RecruitType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ export interface RecruitCardProps {
requiredFieldCheck?: RequiredFieldCheckProps;
}

interface Item {
id: number;
text: string;
}

export interface RecruitDetailProps {
salary: string;
workDuration: string;
workDays: string;
workType: string;
workHours: string;
detailedDescription: string;
majorBusiness: Item[];
eligibilityCriteria: Item[];
preferredConditions: Item[];
majorBusiness: string;
eligibilityCriteria: string;
preferredConditions: string;
employerName: string;
companyName: string;
koreanDetailedDescription: string;
Expand Down
4 changes: 1 addition & 3 deletions src/pages/recruit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ export default function Recruit() {
const { recruitmentId = '1' } = useParams();

const { data, isLoading } = useGetRecruitmentsDetail(Number(recruitmentId));
const { data: requiredFieldCheck } = useGetRequiredFieldCheck(Number(recruitmentId));

const { data: requiredFieldCheck } = useGetRequiredFieldCheck();
if (isLoading || !data) {
return <Spinner />;
}

return (
<Layout>
<Container>
Expand Down
19 changes: 3 additions & 16 deletions src/pages/recruit/stories/RecruitDetail.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const meta: Meta<RecruitDetailProps> = {
component: RecruitDetail,
tags: ['autodocs'],
argTypes: {
detailedDescription: { control: 'text' },
majorBusiness: { control: 'object', description: 'id์™€ text ๊ฐ์ฒด๋ฅผ ์ถ”๊ฐ€ ๋ฐ ์ˆ˜์ •ํ•ด๋ณด์‹ญ์‡ผ!' },
eligibilityCriteria: { control: 'object' },
preferredConditions: { control: 'object' },
Expand All @@ -22,21 +21,9 @@ const meta: Meta<RecruitDetailProps> = {
salary: { control: 'text' },
},
args: {
detailedDescription: '๊น€๋ฐฅ ๋งŒ๋“ค๊ธฐ ์•Œ๋ฐ”',
majorBusiness: [
{ id: 1, text: '๊น€๋ฐฅ ๋งŒ๋“ค๊ธฐ' },
{ id: 2, text: '์žฌ๋ฃŒ ์ „์ฒ˜๋ฆฌ' },
{ id: 3, text: '๋งˆ๊ฐ ์ฒญ์†Œ' },
],
eligibilityCriteria: [
{ id: 1, text: '๋น„์ž๋ฅผ ๊ฐ€์ง„ ์‚ฌ๋žŒ' },
{ id: 2, text: '์ฃผ 2ํšŒ ์ด์ƒ ๊ทผ๋ฌด ๊ฐ€๋Šฅํ•œ ์‚ฌ๋žŒ' },
],
preferredConditions: [
{ id: 1, text: 'ํ•œ๊ตญ์–ด ์˜์‚ฌ ์†Œํ†ต์ด ์ž˜ ๋˜๋Š” ์‚ฌ๋žŒ' },
{ id: 2, text: '์ง€๊ฐํ•˜์ง€ ์•Š๋Š” ์‚ฌ๋žŒ' },
{ id: 3, text: '๊น€๋ฐฅ์— ์žˆ๋Š” ์˜ค์ด๋ฅผ ๋นผ์ง€ ์•Š๋Š” ์‚ฌ๋žŒ' },
],
majorBusiness: '๊น€๋ฐฅ ๋งŒ๋“ค๊ธฐ',
eligibilityCriteria: '๋น„์ž๋ฅผ ๊ฐ€์ง„ ์‚ฌ๋žŒ',
preferredConditions: 'ํ•œ๊ตญ์–ด ์˜์‚ฌ ์†Œํ†ต์ด ์ž˜ ๋˜๋Š” ์‚ฌ๋žŒ',
employerName: '์ด์žฌ์šฉ',
companyName: '์‚ผ์„ฑ์ „์ž',
koreanDetailedDescription: '๊น€๋ฐฅ ๋งŒ๋“ค๊ธฐ ์•„๋ฅด๋ฐ”์ดํŠธ',
Expand Down
4 changes: 2 additions & 2 deletions src/routes/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export const AUTH = {
} as const;

export const APPLY = {
GUIDE: '/applyguide',
APPLYPAGE: '/apply',
GUIDE: '/applyguide/:recruitmentId',
APPLYPAGE: '/apply/:recruitmentId',
} as const;

export const MY_PAGE = {
Expand Down

0 comments on commit 9797ff9

Please sign in to comment.