Skip to content

Commit e9e8fb9

Browse files
committed
Refactor: 댓글부분 link 수정 #65
1 parent 793e2b8 commit e9e8fb9

File tree

3 files changed

+13
-18
lines changed

3 files changed

+13
-18
lines changed

components/ui/BoardCard/BoardCardPackage/CommentWrapper.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ export function BoardCardCommentWrapper({
7373
{children}
7474
</FlexBox>
7575
) : (
76-
<FlexBox direction="row" className="gap-[19px] pl-[15px]">
76+
<FlexBox
77+
direction="row"
78+
justify="start"
79+
className="w-full gap-[19px] pl-[15px]"
80+
>
7781
<Image
7882
src="/Feed/desktop/commentLine.svg"
7983
alt="댓글선"

components/ui/BoardCard/BoardCardPackage/Comments.tsx

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
/* eslint-disable jsx-a11y/no-static-element-interactions */
22
/* eslint-disable jsx-a11y/click-events-have-key-events */
3-
import { useRouter } from 'next/navigation';
4-
53
export default function BoardCardComments({
6-
boardId,
74
userName,
85
content,
96
}: {
10-
boardId: number;
117
userName: string;
128
content: string;
139
}) {
14-
const router = useRouter();
15-
1610
return (
17-
<div
18-
className="flex flex-row hover:cursor-pointer"
19-
onClick={() => router.push(`/board/${boardId}`)}
20-
>
11+
<div className="flex flex-row hover:cursor-pointer">
2112
<div className="inline-block mr-1 body2 text-grey-500">{userName}</div>
2213
<div className="inline body4 text-grey-500">{content}</div>
2314
</div>

components/ui/BoardCard/FeedBoardCard.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
/* eslint-disable jsx-a11y/click-events-have-key-events */
33
import { Board } from '@/types/types';
44
import { BoardCard } from '@/components/ui/BoardCard/BoardCardPackage';
5+
import { useRouter } from 'next/navigation';
56
import FlexBox from '../FlexBox';
67

78
export default function FeedBoardCard({ board }: { board: Board }) {
9+
const router = useRouter();
10+
811
return (
912
<FlexBox
1013
direction="column"
@@ -24,21 +27,18 @@ export default function FeedBoardCard({ board }: { board: Board }) {
2427
likedCount={board.likedCount}
2528
isLiked={board.boardLiked}
2629
>
27-
<FlexBox
28-
direction="column"
29-
justify="start"
30-
align="start"
31-
className="max-h-[74px] overflow-hidden"
30+
<div
31+
className="flex flex-col justify-start items-start max-h-[74px] overflow-hidden w-full hover:cursor-pointer"
32+
onClick={() => router.push(`/board/${board.id}`)}
3233
>
3334
{board.replyListDto?.map((comment) => (
3435
<BoardCard.Comments
3536
key={comment.id}
36-
boardId={board.id}
3737
userName={comment.nickname}
3838
content={comment.content}
3939
/>
4040
))}
41-
</FlexBox>
41+
</div>
4242
</BoardCard.BoardCardCommentWrapper>
4343
</BoardCard.Content>
4444
</FlexBox>

0 commit comments

Comments
 (0)