From 778e9f7a7939bc51ff62c93fda8ed76520c55de0 Mon Sep 17 00:00:00 2001 From: TaeeunKim Date: Mon, 16 Oct 2023 15:03:39 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=EC=9D=B4=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20ui=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Recipe/CommentList/CommentList.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/Recipe/CommentList/CommentList.tsx b/frontend/src/components/Recipe/CommentList/CommentList.tsx index 5a34feb95..093d5d93e 100644 --- a/frontend/src/components/Recipe/CommentList/CommentList.tsx +++ b/frontend/src/components/Recipe/CommentList/CommentList.tsx @@ -1,4 +1,4 @@ -import { Heading, Spacing } from '@fun-eat/design-system'; +import { Heading, Spacing, Text, theme } from '@fun-eat/design-system'; import { useRef } from 'react'; import CommentItem from '../CommentItem/CommentItem'; @@ -24,6 +24,7 @@ const CommentList = ({ recipeId }: CommentListProps) => { 댓글 ({comments.length}개) + {comments.length === 0 && 꿀조합의 첫번째 댓글을 달아보세요!} {comments.map((comment) => ( ))} From bdc7fcd90b5cfe139275002626f549dfbe39ec32 Mon Sep 17 00:00:00 2001 From: TaeeunKim Date: Mon, 16 Oct 2023 15:04:23 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=EC=9D=B4=20?= =?UTF-8?q?=EC=97=86=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20id=EB=A5=BC=20?= =?UTF-8?q?=EC=9D=BD=EC=96=B4=EC=98=AC=20=EC=88=98=20=EC=97=86=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts b/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts index ec251f9b5..dd870941b 100644 --- a/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts +++ b/frontend/src/hooks/queries/recipe/useInfiniteRecipeCommentQuery.ts @@ -27,7 +27,7 @@ const useInfiniteRecipeCommentQuery = (recipeId: number) => { ({ pageParam = { lastId: 0, totalElements: null } }) => fetchRecipeComments(pageParam, recipeId), { getNextPageParam: (prevResponse: CommentResponse) => { - const lastId = prevResponse.comments[prevResponse.comments.length - 1].id; + const lastId = prevResponse.comments.length ? prevResponse.comments[prevResponse.comments.length - 1].id : 0; const totalElements = prevResponse.totalElements; const lastCursor = { lastId: lastId, totalElements: totalElements }; return prevResponse.hasNext ? lastCursor : undefined;