Skip to content

Commit

Permalink
타인의 템플릿 페이지에서 노출된 업로드 버튼 오류 수정 (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
healim01 authored Dec 18, 2024
1 parent 0f72be3 commit 093bf5a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion frontend/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const enableMocking = async () => {
return;
}

// const { worker } = await import('./mocks/browser');
// const { worker } = await import('@/mocks/settings/browser');

// await worker.start();
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/mocks/handlers/category.ts
Original file line number Diff line number Diff line change
@@ -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 } }),
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/MyTemplatesPage/MyTemplatePage.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -126,6 +126,7 @@ const MyTemplatePage = () => {
templateList={templateList}
isSearching={inputKeyword !== '' || inputKeyword !== searchedKeyword}
isEditMode={isEditMode}
isMine={isMine}
selectedList={selectedList}
setSelectedList={setSelectedList}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ interface Props {
templateList: TemplateListItem[];
isEditMode: boolean;
isSearching: boolean;
isMine: boolean;
selectedList: number[];
setSelectedList: React.Dispatch<React.SetStateAction<number[]>>;
}

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 ? <NoResults>검색 결과가 없습니다.</NoResults> : <NewTemplateButton />;
if (!isMine || isSearching) return <NoResults>검색 결과가 없습니다.</NoResults>
return <NewTemplateButton />;
}

return (
Expand Down

0 comments on commit 093bf5a

Please sign in to comment.