From 84606b25f403982f45c57633d69c5e31b448a070 Mon Sep 17 00:00:00 2001 From: BangDori Date: Thu, 9 May 2024 16:12:50 +0900 Subject: [PATCH 01/22] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=ED=85=8C=EB=91=90=EB=A6=AC=20=EC=83=89?= =?UTF-8?q?=EC=83=81=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/sprites/common.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/sprites/common.svg b/public/assets/sprites/common.svg index ad0924a..513aa38 100644 --- a/public/assets/sprites/common.svg +++ b/public/assets/sprites/common.svg @@ -58,7 +58,7 @@ Date: Thu, 9 May 2024 16:13:28 +0900 Subject: [PATCH 02/22] =?UTF-8?q?feat:=20=EC=A2=8B=EC=95=84=EC=9A=94=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/features/.gitkeep | 0 src/features/feed-main-like/index.ts | 1 + src/features/feed-main-like/ui/LikeButton.tsx | 18 ++++++++++++++++++ src/features/feed-main-like/ui/index.ts | 1 + src/features/index.ts | 1 + src/shared/ui/icon/ui/Icon.tsx | 5 ++++- src/widgets/feed-main-list/ui/Feed.tsx | 7 +++---- 7 files changed, 28 insertions(+), 5 deletions(-) delete mode 100644 src/features/.gitkeep create mode 100644 src/features/feed-main-like/index.ts create mode 100644 src/features/feed-main-like/ui/LikeButton.tsx create mode 100644 src/features/feed-main-like/ui/index.ts create mode 100644 src/features/index.ts diff --git a/src/features/.gitkeep b/src/features/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/features/feed-main-like/index.ts b/src/features/feed-main-like/index.ts new file mode 100644 index 0000000..7f4d6b7 --- /dev/null +++ b/src/features/feed-main-like/index.ts @@ -0,0 +1 @@ +export { LikeButton } from './ui'; diff --git a/src/features/feed-main-like/ui/LikeButton.tsx b/src/features/feed-main-like/ui/LikeButton.tsx new file mode 100644 index 0000000..f0db08f --- /dev/null +++ b/src/features/feed-main-like/ui/LikeButton.tsx @@ -0,0 +1,18 @@ +import { Icon } from '@/shared/ui'; + +interface LikeButtonProps { + isLiked: boolean; +} + +export const LikeButton: React.FC = ({ isLiked }) => { + return ( + + ); +}; diff --git a/src/features/feed-main-like/ui/index.ts b/src/features/feed-main-like/ui/index.ts new file mode 100644 index 0000000..09ac69b --- /dev/null +++ b/src/features/feed-main-like/ui/index.ts @@ -0,0 +1 @@ +export { LikeButton } from './LikeButton'; diff --git a/src/features/index.ts b/src/features/index.ts new file mode 100644 index 0000000..ebed232 --- /dev/null +++ b/src/features/index.ts @@ -0,0 +1 @@ +export { LikeButton } from './feed-main-like'; diff --git a/src/shared/ui/icon/ui/Icon.tsx b/src/shared/ui/icon/ui/Icon.tsx index de10109..59668fd 100644 --- a/src/shared/ui/icon/ui/Icon.tsx +++ b/src/shared/ui/icon/ui/Icon.tsx @@ -10,7 +10,10 @@ interface IconProps { export const Icon: React.FC = ({ name, width, height, color }) => { return ( - + ); }; diff --git a/src/widgets/feed-main-list/ui/Feed.tsx b/src/widgets/feed-main-list/ui/Feed.tsx index 9093645..136c6db 100644 --- a/src/widgets/feed-main-list/ui/Feed.tsx +++ b/src/widgets/feed-main-list/ui/Feed.tsx @@ -1,3 +1,4 @@ +import { LikeButton } from '@/features'; import { Feed as FeedProps } from '@/shared/consts'; import { Icon, Profile } from '@/shared/ui'; import { calculateElapsedTime } from '@/shared/utils'; @@ -5,7 +6,7 @@ import { calculateElapsedTime } from '@/shared/utils'; import './Feed.scss'; export const Feed: React.FC<{ feed: FeedProps }> = ({ feed }) => { - const { user, content, likeCount, commentCount, updatedAt } = feed; + const { user, content, likeCount, commentCount, updatedAt, isLiked } = feed; return (
@@ -31,9 +32,7 @@ export const Feed: React.FC<{ feed: FeedProps }> = ({ feed }) => {