Skip to content

Commit 2fc70ce

Browse files
committed
[fix] 코멘트 삭제수정 마이페이지에선 뗄수있게 myPage props 추가
1 parent 0f52000 commit 2fc70ce

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/domains/shared/components/comment/CommentList.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type Props = {
1515
onLoadMore?: (lastCommentId: number) => void; // ← 무한스크롤 콜백
1616
isEnd?: boolean;
1717
isLoading: boolean;
18+
myPage: boolean;
1819
};
1920

2021
function CommentList({
@@ -24,6 +25,7 @@ function CommentList({
2425
onDeleteComment,
2526
onLoadMore,
2627
isEnd,
28+
myPage = false,
2729
}: Props) {
2830
const parentRef = useRef<HTMLDivElement | null>(null);
2931
const [editCommentId, setEditCommentId] = useState<number | null>(null);
@@ -107,6 +109,7 @@ function CommentList({
107109
commentTime={createdAt}
108110
isMyComment={isMyComment}
109111
isEditing={isEditing}
112+
myPage={myPage}
110113
onSubmitEdit={() => {
111114
const updatedContent = editedContentMap[commentId];
112115
if (!updatedContent) return;

src/domains/shared/components/comment/CommentTitle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Props = {
1111
onSubmitEdit: () => void;
1212
onDelete: () => void;
1313
isMyComment: boolean | null;
14+
myPage: boolean;
1415
};
1516

1617
function CommentTitle({
@@ -22,6 +23,7 @@ function CommentTitle({
2223
onSubmitEdit,
2324
onDelete,
2425
isMyComment,
26+
myPage,
2527
}: Props) {
2628
return (
2729
<div className="flex items-center justify-between">
@@ -30,7 +32,7 @@ function CommentTitle({
3032
<span className="md:text-sm text-[11px]">|</span>
3133
<p className="md:text-sm text-[11px] text-gray">{elapsedTime(commentTime)}</p>
3234
</div>
33-
{isMyComment && (
35+
{isMyComment && !myPage && (
3436
<EditDelete
3537
use="comment"
3638
onSubmitEdit={onSubmitEdit}

0 commit comments

Comments
 (0)