From 6a3b79bfbf66403fdac1d2464c8af04a6eecbda7 Mon Sep 17 00:00:00 2001 From: BangDori Date: Thu, 2 May 2024 21:05:02 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EA=B3=B5=EC=9A=A9=20=ED=83=80=EC=9E=85?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feed-main-list/api/useInfinityFeeds.tsx | 5 ++- src/widgets/feed/consts/type.ts | 36 ------------------- src/widgets/feed/ui/Feed.tsx | 4 +-- 3 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 src/widgets/feed/consts/type.ts diff --git a/src/widgets/feed-main-list/api/useInfinityFeeds.tsx b/src/widgets/feed-main-list/api/useInfinityFeeds.tsx index 8962313..5459c9f 100644 --- a/src/widgets/feed-main-list/api/useInfinityFeeds.tsx +++ b/src/widgets/feed-main-list/api/useInfinityFeeds.tsx @@ -1,14 +1,13 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import { axiosInstance } from '@/shared/axios'; -import { QUERY_KEYS } from '@/shared/consts'; -import { FeedList } from '@/widgets/feed/consts/type'; +import { Feed, QUERY_KEYS } from '@/shared/consts'; interface FetchFeeds { code: string; data: { currentPageNumber: number; - feeds: FeedList; + feeds: Feed[]; hasNext: boolean; numberOfElements: number; pageSize: number; diff --git a/src/widgets/feed/consts/type.ts b/src/widgets/feed/consts/type.ts deleted file mode 100644 index b19cb05..0000000 --- a/src/widgets/feed/consts/type.ts +++ /dev/null @@ -1,36 +0,0 @@ -export interface FeedProps { - feed: Feed; -} - -export type FeedList = Feed[]; - -export interface Feed { - id: number; - - user: User; - - title: string; - content: string; - images: Image[]; - - likeCount: number; - commentCount: number; - - isLiked: boolean; - isBookmark: boolean; - - createdAt: string; - updatedAt: string; -} - -interface Image { - id: number; - imageUrl: string; -} - -interface User { - id: number; - profileImage: string; - name: string; - content: string; -} diff --git a/src/widgets/feed/ui/Feed.tsx b/src/widgets/feed/ui/Feed.tsx index 6d3673e..9093645 100644 --- a/src/widgets/feed/ui/Feed.tsx +++ b/src/widgets/feed/ui/Feed.tsx @@ -1,10 +1,10 @@ +import { Feed as FeedProps } from '@/shared/consts'; import { Icon, Profile } from '@/shared/ui'; import { calculateElapsedTime } from '@/shared/utils'; import './Feed.scss'; -import { FeedProps } from '../consts/type'; -export const Feed: React.FC = ({ feed }) => { +export const Feed: React.FC<{ feed: FeedProps }> = ({ feed }) => { const { user, content, likeCount, commentCount, updatedAt } = feed; return (