From 799d9f4dfb118f7399bcc8337d7d0d7f7459f4f6 Mon Sep 17 00:00:00 2001 From: f0ever0 Date: Wed, 20 Sep 2023 18:31:35 +0900 Subject: [PATCH] =?UTF-8?q?refactor=20:=20parsePartToKorean=20=EA=B3=B5?= =?UTF-8?q?=EC=9A=A9=20utils=20=EB=A1=9C=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common => lib/utils}/parsePartToKorean.ts | 0 .../components/Cirriculum/Content/index.tsx | 2 +- .../ActivityReview/ActivityReview.tsx | 2 +- .../ActivityReview/utils/parsePartToKorean.ts | 19 ------------------- .../ActivityReview/ActivityReview.tsx | 2 +- .../ActivityReview/utils/parsePartToKorean.ts | 19 ------------------- .../components/ChapterInfo/index.tsx | 4 ++-- src/views/StudyPage/components/Item/index.tsx | 2 +- 8 files changed, 6 insertions(+), 44 deletions(-) rename src/{components/common => lib/utils}/parsePartToKorean.ts (100%) delete mode 100644 src/views/MainPage/components/ActivityReview/utils/parsePartToKorean.ts delete mode 100644 src/views/RecruitPage/components/ActivityReview/utils/parsePartToKorean.ts diff --git a/src/components/common/parsePartToKorean.ts b/src/lib/utils/parsePartToKorean.ts similarity index 100% rename from src/components/common/parsePartToKorean.ts rename to src/lib/utils/parsePartToKorean.ts diff --git a/src/views/AboutPage/components/Cirriculum/Content/index.tsx b/src/views/AboutPage/components/Cirriculum/Content/index.tsx index ebcd39d6..80225914 100644 --- a/src/views/AboutPage/components/Cirriculum/Content/index.tsx +++ b/src/views/AboutPage/components/Cirriculum/Content/index.tsx @@ -1,8 +1,8 @@ import Image from 'next/image'; import { useState } from 'react'; import Flex from '@src/components/common/Flex'; -import { parsePartToKorean } from '@src/components/common/parsePartToKorean'; import { Part } from '@src/lib/types/universal'; +import { parsePartToKorean } from '@src/lib/utils/parsePartToKorean'; import TabBar from '../../common/TabBar'; import * as St from './style'; diff --git a/src/views/MainPage/components/ActivityReview/ActivityReview.tsx b/src/views/MainPage/components/ActivityReview/ActivityReview.tsx index 4a694d08..d5c09920 100644 --- a/src/views/MainPage/components/ActivityReview/ActivityReview.tsx +++ b/src/views/MainPage/components/ActivityReview/ActivityReview.tsx @@ -3,10 +3,10 @@ import { ReactComponent as ArrowLeft } from '@src/assets/icons/arrow_left_28x28. import { ReactComponent as ArrowRight } from '@src/assets/icons/arrow_right_28x28.svg'; import ArrowRightGrey from '@src/assets/icons/arrow_right_grey.svg'; import { useHorizontalScroll } from '@src/hooks/useHorizontalScroll'; +import { parsePartToKorean } from '@src/lib/utils/parsePartToKorean'; import cc from 'classcat'; import styles from './activity-review.module.scss'; import useFetch from './hooks/useFetch'; -import { parsePartToKorean } from './utils/parsePartToKorean'; export function ActivityReview() { const reviews = useFetch(); diff --git a/src/views/MainPage/components/ActivityReview/utils/parsePartToKorean.ts b/src/views/MainPage/components/ActivityReview/utils/parsePartToKorean.ts deleted file mode 100644 index b7f802ea..00000000 --- a/src/views/MainPage/components/ActivityReview/utils/parsePartToKorean.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Part } from '@src/lib/types/universal'; - -// TODO :: ReviewType의 part 타입을 string -> TAB 변경 -export function parsePartToKorean(part: string) { - switch (part) { - case Part.ANDROID: - return '안드로이드'; - case Part.WEB: - return '웹'; - case Part.DESIGN: - return '디자인'; - case Part.PLAN: - return '기획'; - case Part.SERVER: - return '서버'; - default: - return part; - } -} diff --git a/src/views/RecruitPage/components/ActivityReview/ActivityReview.tsx b/src/views/RecruitPage/components/ActivityReview/ActivityReview.tsx index 20a106c7..7738bcd7 100644 --- a/src/views/RecruitPage/components/ActivityReview/ActivityReview.tsx +++ b/src/views/RecruitPage/components/ActivityReview/ActivityReview.tsx @@ -3,6 +3,7 @@ import { ReactComponent as ArrowLeft } from '@src/assets/icons/arrow_left_28x28. import { ReactComponent as ArrowRight } from '@src/assets/icons/arrow_right_28x28.svg'; import arrowRightWhite from '@src/assets/icons/arrow_right_white.svg'; import { useHorizontalScroll } from '@src/hooks/useHorizontalScroll'; +import { parsePartToKorean } from '@src/lib/utils/parsePartToKorean'; import { SectionTitle, SectionTitleTranslate, SectionTitleWrapper } from '../common/styles'; import useFetch from './hooks/useFetch'; import { @@ -18,7 +19,6 @@ import { DescWrapper, MoreLinkWrapper, } from './styles'; -import { parsePartToKorean } from './utils/parsePartToKorean'; export function ActivityReview() { const reviews = useFetch(); diff --git a/src/views/RecruitPage/components/ActivityReview/utils/parsePartToKorean.ts b/src/views/RecruitPage/components/ActivityReview/utils/parsePartToKorean.ts deleted file mode 100644 index b7f802ea..00000000 --- a/src/views/RecruitPage/components/ActivityReview/utils/parsePartToKorean.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Part } from '@src/lib/types/universal'; - -// TODO :: ReviewType의 part 타입을 string -> TAB 변경 -export function parsePartToKorean(part: string) { - switch (part) { - case Part.ANDROID: - return '안드로이드'; - case Part.WEB: - return '웹'; - case Part.DESIGN: - return '디자인'; - case Part.PLAN: - return '기획'; - case Part.SERVER: - return '서버'; - default: - return part; - } -} diff --git a/src/views/RecruitPage/components/ChapterInfo/index.tsx b/src/views/RecruitPage/components/ChapterInfo/index.tsx index ac5695fe..94f7a1ee 100644 --- a/src/views/RecruitPage/components/ChapterInfo/index.tsx +++ b/src/views/RecruitPage/components/ChapterInfo/index.tsx @@ -2,7 +2,7 @@ import styled from '@emotion/styled'; import { useState } from 'react'; import Flex from '@src/components/common/Flex'; import { Part } from '@src/lib/types/universal'; -import { parsePartToKorean } from '@src/views/MainPage/components/ActivityReview/utils/parsePartToKorean'; +import { parsePartToKorean } from '@src/lib/utils/parsePartToKorean'; import TabBar from '../common/Tabs'; import { SectionTitle, SectionTitleTranslate, SectionTitleWrapper } from '../common/styles'; import { infoMap } from './constants'; @@ -42,7 +42,7 @@ const BaseChip = styled.div` line-height: 22px; font-size: 22px; - /* 태블릿 뷰 */ + /* 태블릿 뷰 */ @media (max-width: 1299px) and (min-width: 766px) { padding: 8px 20px; font-size: 18px; diff --git a/src/views/StudyPage/components/Item/index.tsx b/src/views/StudyPage/components/Item/index.tsx index 7d53d4cf..0a3aeeab 100644 --- a/src/views/StudyPage/components/Item/index.tsx +++ b/src/views/StudyPage/components/Item/index.tsx @@ -2,8 +2,8 @@ import Image from 'next/image'; import { useMemo } from 'react'; import Flex from '@src/components/common/Flex'; import { StudyInfoType } from '@src/lib/types/about'; +import { parsePartToKorean } from '@src/lib/utils/parsePartToKorean'; import { formatDate } from '@src/utils/dateFormat'; -import { parsePartToKorean } from '@src/views/MainPage/components/ActivityReview/utils/parsePartToKorean'; import * as St from './style'; type StudyItemProps = {