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 (