Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/group/GroupCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const Info = styled.div`
flex-direction: column;
justify-content: space-between;
flex: 1;
min-width: 0; /* flex 아이템이 부모 너비를 넘지 않도록 */
`;

const Title = styled.h3<{ isRecommend: boolean }>`
Expand All @@ -123,6 +124,7 @@ const Title = styled.h3<{ isRecommend: boolean }>`
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 100%; /* 부모 컨테이너의 전체 너비 사용 */
`;

const Bottom = styled.div`
Expand Down
14 changes: 13 additions & 1 deletion src/pages/feed/FeedDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,22 @@ const FeedDetailPage = () => {
try {
const commentsResponse = await getComments(Number(feedId), { postType: 'FEED' });
setCommentList(commentsResponse.data.commentList);

// 피드 데이터의 댓글 수를 실제 댓글 목록 길이로 업데이트
if (feedData) {
setFeedData(prev =>
prev
? {
...prev,
commentCount: commentsResponse.data.commentList.length,
}
: null,
);
}
} catch (err) {
console.error('댓글 목록 다시 로드 실패:', err);
}
}, [feedId]);
}, [feedId, feedData]);

// 페이지를 떠날 때 답글 상태 초기화
useEffect(() => {
Expand Down