From ce5c2774d6d3a759cf757e7b7bf0db7df55971f5 Mon Sep 17 00:00:00 2001 From: Parkchaeyeon Date: Fri, 27 Sep 2024 05:50:44 +0900 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=EC=A0=84=EC=B2=B4=20=EC=B9=B4?= =?UTF-8?q?=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/svg/active/ic_all_active.svg | 101 ++++++++ public/svg/inactive/ic_all_inactive.svg | 101 ++++++++ src/assets/svg/active/IcAllActive.tsx | 221 ++++++++++++++++++ src/assets/svg/active/index.ts | 1 + src/assets/svg/inactive/IcAllInactive.tsx | 221 ++++++++++++++++++ src/assets/svg/inactive/index.ts | 1 + src/constants/category.tsx | 1 + .../classList/page/ClassList/ClassList.tsx | 15 +- 8 files changed, 661 insertions(+), 1 deletion(-) create mode 100644 public/svg/active/ic_all_active.svg create mode 100644 public/svg/inactive/ic_all_inactive.svg create mode 100644 src/assets/svg/active/IcAllActive.tsx create mode 100644 src/assets/svg/inactive/IcAllInactive.tsx diff --git a/public/svg/active/ic_all_active.svg b/public/svg/active/ic_all_active.svg new file mode 100644 index 00000000..5a1acd54 --- /dev/null +++ b/public/svg/active/ic_all_active.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/svg/inactive/ic_all_inactive.svg b/public/svg/inactive/ic_all_inactive.svg new file mode 100644 index 00000000..13f102c5 --- /dev/null +++ b/public/svg/inactive/ic_all_inactive.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/svg/active/IcAllActive.tsx b/src/assets/svg/active/IcAllActive.tsx new file mode 100644 index 00000000..abc7c3aa --- /dev/null +++ b/src/assets/svg/active/IcAllActive.tsx @@ -0,0 +1,221 @@ +import type { SVGProps } from 'react'; +const SvgIcAllActive = (props: SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); +export default SvgIcAllActive; diff --git a/src/assets/svg/active/index.ts b/src/assets/svg/active/index.ts index be8c4093..6ed94c38 100644 --- a/src/assets/svg/active/index.ts +++ b/src/assets/svg/active/index.ts @@ -1,3 +1,4 @@ +export { default as IcAllActive } from './IcAllActive'; export { default as IcEducationActive } from './IcEducationActive'; export { default as IcEmploymentActive } from './IcEmploymentActive'; export { default as IcInvestmentActive } from './IcInvestmentActive'; diff --git a/src/assets/svg/inactive/IcAllInactive.tsx b/src/assets/svg/inactive/IcAllInactive.tsx new file mode 100644 index 00000000..c269e8b2 --- /dev/null +++ b/src/assets/svg/inactive/IcAllInactive.tsx @@ -0,0 +1,221 @@ +import type { SVGProps } from 'react'; +const SvgIcAllInactive = (props: SVGProps) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +); +export default SvgIcAllInactive; diff --git a/src/assets/svg/inactive/index.ts b/src/assets/svg/inactive/index.ts index b97b7afb..85204a44 100644 --- a/src/assets/svg/inactive/index.ts +++ b/src/assets/svg/inactive/index.ts @@ -1,3 +1,4 @@ +export { default as IcAllInactive } from './IcAllInactive'; export { default as IcEducationInactive } from './IcEducationInactive'; export { default as IcEmploymentInactive } from './IcEmploymentInactive'; export { default as IcInvestmentInactive } from './IcInvestmentInactive'; diff --git a/src/constants/category.tsx b/src/constants/category.tsx index 5fc057b2..072d5ada 100644 --- a/src/constants/category.tsx +++ b/src/constants/category.tsx @@ -19,6 +19,7 @@ export const CATEGORY_ICON: CategoryIcon = { }; export const CATEGORY_NAME: CategoryName = { + all: '전체', njob: 'N잡', investment: '재테크', startup: '창업', diff --git a/src/pages/classList/page/ClassList/ClassList.tsx b/src/pages/classList/page/ClassList/ClassList.tsx index 78a64a80..a3244a3d 100644 --- a/src/pages/classList/page/ClassList/ClassList.tsx +++ b/src/pages/classList/page/ClassList/ClassList.tsx @@ -19,6 +19,7 @@ import { IcMarketingActive, IcEducationActive, IcItActive, + IcAllActive, } from 'src/assets/svg/active'; import { IcNjobInactive, @@ -30,6 +31,7 @@ import { IcMarketingInactive, IcEducationInactive, IcItInactive, + IcAllInactive, } from 'src/assets/svg/inactive'; import { @@ -45,6 +47,7 @@ import { } from './ClassList.style'; const activeCategoryIcon: { [key: string]: JSX.Element } = { + all: , njob: , investment: , startup: {`startup-icon-active`}, @@ -57,6 +60,7 @@ const activeCategoryIcon: { [key: string]: JSX.Element } = { it: , }; const inactiveCategoryIcon: { [key: string]: JSX.Element } = { + all: , njob: , investment: , startup: {`startup-icon-inactive`}, @@ -75,7 +79,8 @@ const ClassList = () => { const [searchParams, setSearchParams] = useSearchParams(); const { data: categories } = useFetchMoimCategories(); - const selectedCategory = searchParams.get('category') || (categories ?? [])[0]; + // const selectedCategory = searchParams.get('category') || (categories ?? [])[0]; + const selectedCategory = searchParams.get('category') || 'all'; const { data: moimList, refetch, isLoading } = useFetchMoimListByCategory(selectedCategory); useEffect(() => { @@ -123,10 +128,18 @@ const ClassList = () => { return ; } + console.log(categories); + return ( <>
    +
  • handleCategoryClick('all')}> + {selectedCategory === 'all' ? activeCategoryIcon['all'] : inactiveCategoryIcon['all']} +

    + {CATEGORY_NAME['all']} +

    +
  • {(categories ?? []).map((category) => { return (
  • handleCategoryClick(category)}> From 48b8218bd97ff98ff31a7e4bd0ef031b19486966 Mon Sep 17 00:00:00 2001 From: Parkchaeyeon Date: Fri, 27 Sep 2024 17:16:42 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=EC=B2=AB=EB=B2=88=EC=A7=B8=20?= =?UTF-8?q?=EB=B0=B0=EB=84=88=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EB=AA=A8=EC=9E=84=EC=9D=B4=20=EB=B3=B4=EC=9D=B4?= =?UTF-8?q?=EB=8A=94=20ClassList=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 --- src/pages/home/page/Home/Home.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/page/Home/Home.tsx b/src/pages/home/page/Home/Home.tsx index ff0c0d7e..aecab718 100644 --- a/src/pages/home/page/Home/Home.tsx +++ b/src/pages/home/page/Home/Home.tsx @@ -57,7 +57,7 @@ const Home = () => { const handleBannerClick = (banner: number) => { if (banner === 0) { - navigate(`class/${bannerId}`); + navigate(`/class-list?category=all`); } else if (banner === 1) { navigate(`mypage/host`); } From 1819acad90587a84cfa6404b53dcdc9b5e08dbae Mon Sep 17 00:00:00 2001 From: Parkchaeyeon Date: Fri, 27 Sep 2024 17:19:24 +0900 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=ED=95=84=EC=9A=94=20=EC=97=86?= =?UTF-8?q?=EB=8A=94=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/classList/page/ClassList/ClassList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/classList/page/ClassList/ClassList.tsx b/src/pages/classList/page/ClassList/ClassList.tsx index a3244a3d..01734c63 100644 --- a/src/pages/classList/page/ClassList/ClassList.tsx +++ b/src/pages/classList/page/ClassList/ClassList.tsx @@ -79,7 +79,6 @@ const ClassList = () => { const [searchParams, setSearchParams] = useSearchParams(); const { data: categories } = useFetchMoimCategories(); - // const selectedCategory = searchParams.get('category') || (categories ?? [])[0]; const selectedCategory = searchParams.get('category') || 'all'; const { data: moimList, refetch, isLoading } = useFetchMoimListByCategory(selectedCategory);