From 093bf5af11137fc651363e0f659eb42b18e1e29d Mon Sep 17 00:00:00 2001 From: Hailey <74346290+healim01@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:29:42 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=80=EC=9D=B8=EC=9D=98=20=ED=85=9C?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=85=B8=EC=B6=9C=EB=90=9C=20=EC=97=85=EB=A1=9C?= =?UTF-8?q?=EB=93=9C=20=EB=B2=84=ED=8A=BC=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#974)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/index.tsx | 2 +- frontend/src/mocks/handlers/category.ts | 4 +++- frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx | 3 ++- .../components/TemplateListSection/TemplateListSection.tsx | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/index.tsx b/frontend/src/index.tsx index 880cbfe6a..fdb292d77 100644 --- a/frontend/src/index.tsx +++ b/frontend/src/index.tsx @@ -35,7 +35,7 @@ const enableMocking = async () => { return; } - // const { worker } = await import('./mocks/browser'); + // const { worker } = await import('@/mocks/settings/browser'); // await worker.start(); }; diff --git a/frontend/src/mocks/handlers/category.ts b/frontend/src/mocks/handlers/category.ts index 95a7137f7..c5d95c7db 100644 --- a/frontend/src/mocks/handlers/category.ts +++ b/frontend/src/mocks/handlers/category.ts @@ -1,11 +1,13 @@ import { http } from 'msw'; import { API_URL } from '@/api'; -import { categories as mockCategoryList } from '@/mocks/fixtures/categoryList.json'; +import categories from '@/mocks/fixtures/categoryList.json'; import { END_POINTS } from '@/routes'; import { Category } from '@/types'; import { mockResponse } from '@/utils/mockResponse'; +const mockCategoryList = [...categories.categories]; + export const categoryHandlers = [ http.get(`${API_URL}${END_POINTS.CATEGORIES}`, () => mockResponse({ status: 200, body: { categories: mockCategoryList } }), diff --git a/frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx b/frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx index 572e4dcb4..345b33b1a 100644 --- a/frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx +++ b/frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx @@ -1,10 +1,10 @@ import { Suspense } from 'react'; import { useParams } from 'react-router-dom'; +import { SORTING_OPTIONS } from '@/models/templates'; import { SearchIcon } from '@/assets/images'; import { Flex, Input, PagingButtons, Dropdown, Heading } from '@/components'; import { useAuth } from '@/hooks/authentication'; -import { SORTING_OPTIONS } from '@/models/templates'; import { CategoryListSection, CategoryListSectionSkeleton, @@ -126,6 +126,7 @@ const MyTemplatePage = () => { templateList={templateList} isSearching={inputKeyword !== '' || inputKeyword !== searchedKeyword} isEditMode={isEditMode} + isMine={isMine} selectedList={selectedList} setSelectedList={setSelectedList} /> diff --git a/frontend/src/pages/MyTemplatesPage/components/TemplateListSection/TemplateListSection.tsx b/frontend/src/pages/MyTemplatesPage/components/TemplateListSection/TemplateListSection.tsx index 777750192..e46a68545 100644 --- a/frontend/src/pages/MyTemplatesPage/components/TemplateListSection/TemplateListSection.tsx +++ b/frontend/src/pages/MyTemplatesPage/components/TemplateListSection/TemplateListSection.tsx @@ -7,17 +7,19 @@ interface Props { templateList: TemplateListItem[]; isEditMode: boolean; isSearching: boolean; + isMine: boolean; selectedList: number[]; setSelectedList: React.Dispatch>; } const getGridCols = (windowWidth: number) => (windowWidth <= 1024 ? 1 : 2); -const TemplateListSection = ({ templateList, isSearching, isEditMode, selectedList, setSelectedList }: Props) => { +const TemplateListSection = ({ templateList, isSearching, isEditMode, isMine, selectedList, setSelectedList }: Props) => { const windowWidth = useWindowWidth(); if (templateList.length === 0) { - return isSearching ? 검색 결과가 없습니다. : ; + if (!isMine || isSearching) return 검색 결과가 없습니다. + return ; } return (