('');
-
- const { mutate: createComment } = useCreateCommentMutation(
- talkPickId,
- selectedPage,
- );
return (
@@ -60,8 +54,10 @@ const MobileCommentsSection = ({
) : (
- {commentList?.content.map((commentData) => (
+ {commentList?.content.map((commentData, idx) => (
Date: Wed, 19 Feb 2025 00:41:21 +0900
Subject: [PATCH 17/30] =?UTF-8?q?feat:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?=
=?UTF-8?q?=EB=8C=93=EA=B8=80=20Input=20=EB=B0=8F=20=EB=AA=A8=EB=B0=94?=
=?UTF-8?q?=EC=9D=BC=20=EB=8C=93=EA=B8=80=20=EB=A1=9C=EC=A7=81=20=EA=B5=AC?=
=?UTF-8?q?=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TalkPickMobilePage/TalkPickMobilePage.tsx | 20 +++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
index 04d27ae3..0d564dbf 100644
--- a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
+++ b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
@@ -6,6 +6,8 @@ import MobileCommentsSection from '@/components/mobile/organisms/MobileCommentsS
import { useTalkPickDetailQuery } from '@/hooks/api/talk-pick/useTalkPickDetailQuery';
// import { ToggleGroupItem } from '@/types/toggle';
import { useCommentsQuery } from '@/hooks/api/comment/useCommentsQuery';
+import CommentInput from '@/components/mobile/atoms/CommentInput/CommentInput';
+import { useCreateCommentMutation } from '@/hooks/api/comment/useCreateCommentMutation';
import * as S from './TalkPickMobilePage.style';
interface State {
@@ -15,6 +17,8 @@ interface State {
const TalkPickMobilePage = () => {
const [currentPage, setCurrentPage] = useState(1);
+ const [comment, setComment] = useState('');
+
// const { member } = useMemberQuery();
const { talkPickId } = useParams();
@@ -26,10 +30,21 @@ const TalkPickMobilePage = () => {
const { talkPick } = useTalkPickDetailQuery(id);
+ const { mutate: createComment } = useCreateCommentMutation(id, currentPage);
+
const handleCommentPageChange = (newPage: number) => {
setCurrentPage(newPage);
};
+ const handleCommentChange = (value: string) => {
+ setComment(value);
+ };
+
+ const handleCommentSubmit = () => {
+ setComment('');
+ createComment({ content: comment });
+ };
+
const { comments } = useCommentsQuery(
id,
{
@@ -50,6 +65,11 @@ const TalkPickMobilePage = () => {
voted={talkPick?.votedOption !== null}
/>
+
);
};
From 27ad18ac4a1394ec79d7d758827d4c52a67e0838 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 20 Feb 2025 15:47:13 +0900
Subject: [PATCH 18/30] =?UTF-8?q?feat:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?=
=?UTF-8?q?=EB=8D=94=EB=B3=B4=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=95=84?=
=?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EB=B0=8F=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?=
=?UTF-8?q?=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/index.ts | 1 +
src/assets/svg/mobile-arrow-down.svg | 3 +++
.../atoms/MoreButton/MoreButton.style.ts | 14 +++++++++++---
src/components/atoms/MoreButton/MoreButton.tsx | 11 +++++++++--
4 files changed, 24 insertions(+), 5 deletions(-)
create mode 100644 src/assets/svg/mobile-arrow-down.svg
diff --git a/src/assets/index.ts b/src/assets/index.ts
index 5e7fd016..db9d8d2e 100644
--- a/src/assets/index.ts
+++ b/src/assets/index.ts
@@ -156,6 +156,7 @@ export { default as CryEmoji } from './svg/cry-emoji.svg';
export { default as MobileLikeButtonDF } from './svg/mobile-like-button-df.svg';
export { default as MobileLikeButtonPR } from './svg/mobile-like-button-pr.svg';
export { default as MobileArrowUp } from './svg/mobile-arrow-up.svg';
+export { default as MobileArrowDown } from './svg/mobile-arrow-down.svg';
// TODO: 이전 SVG
export { default as Email } from './svg/email.svg';
diff --git a/src/assets/svg/mobile-arrow-down.svg b/src/assets/svg/mobile-arrow-down.svg
new file mode 100644
index 00000000..2062a3e9
--- /dev/null
+++ b/src/assets/svg/mobile-arrow-down.svg
@@ -0,0 +1,3 @@
+
diff --git a/src/components/atoms/MoreButton/MoreButton.style.ts b/src/components/atoms/MoreButton/MoreButton.style.ts
index bfc9b731..a9839745 100644
--- a/src/components/atoms/MoreButton/MoreButton.style.ts
+++ b/src/components/atoms/MoreButton/MoreButton.style.ts
@@ -11,7 +11,15 @@ export const moreButtonStyling = (icon: Required['icon']) =>
gap: '7px',
color: icon === 'plus' ? color.GY[1] : color.MAIN,
cursor: 'pointer',
- '@media (max-width: 430px)': {
- ...typo.Mobile.Text.SemiBold_14,
- },
+ '@media (max-width: 430px)':
+ icon === 'arrow'
+ ? {
+ ...typo.Mobile.Text.Medium_12,
+ color: color.GY[1],
+ gap: '3px',
+ }
+ : {
+ ...typo.Mobile.Text.SemiBold_14,
+ color: color.GY[1],
+ },
});
diff --git a/src/components/atoms/MoreButton/MoreButton.tsx b/src/components/atoms/MoreButton/MoreButton.tsx
index 77cef564..83ef7a51 100644
--- a/src/components/atoms/MoreButton/MoreButton.tsx
+++ b/src/components/atoms/MoreButton/MoreButton.tsx
@@ -1,5 +1,5 @@
import React, { forwardRef, ComponentPropsWithRef, ForwardedRef } from 'react';
-import { More, MoreReply, MoreSmall } from '@/assets';
+import { MobileArrowDown, More, MoreReply, MoreSmall } from '@/assets';
import * as S from './MoreButton.style';
export interface MoreButtonProps extends ComponentPropsWithRef<'button'> {
@@ -12,7 +12,14 @@ const MoreButton = (
ref: ForwardedRef,
) => {
const getIcon = () => {
- if (size === 'small') return ;
+ if (size === 'small') {
+ switch (icon) {
+ case 'arrow':
+ return ;
+ default:
+ return ;
+ }
+ }
return icon === 'plus' ? : ;
};
From fa32ba977d9263689f4c1d5358b6586e6fefc46e Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Fri, 21 Feb 2025 00:57:07 +0900
Subject: [PATCH 19/30] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20=EC=A4=84?=
=?UTF-8?q?=EC=9E=84=20=EC=B5=9C=EB=8C=80=20=EA=B8=B8=EC=9D=B4=20=EC=83=81?=
=?UTF-8?q?=EC=88=98=20=EC=A0=95=EC=9D=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/constants/message.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/constants/message.ts b/src/constants/message.ts
index 7164f7d5..960b56d9 100644
--- a/src/constants/message.ts
+++ b/src/constants/message.ts
@@ -222,4 +222,5 @@ export const COMMENT = {
NO_COMMENTS_YET: '아직 댓글이 없어요',
FIRST_COMMENT_SUGGESTION: '첫 댓글을 달아보는건 어때요?',
MAX_LENGTH: 500,
+ MAX_SHORTEN_LENGTH: 90,
};
From 0c425d08972639bf00769d019a1b4100d2742f8c Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Fri, 21 Feb 2025 00:57:49 +0900
Subject: [PATCH 20/30] =?UTF-8?q?feat:=20=EB=8C=93=EA=B8=80=20=EA=B8=80?=
=?UTF-8?q?=EC=9E=90=20=EC=A0=9C=ED=95=9C=EC=9C=BC=EB=A1=9C=20=EB=8D=94?=
=?UTF-8?q?=EB=B3=B4=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=83=9D=EC=84=B1=20?=
=?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EA=B5=AC=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MobileCommentItem.style.ts | 10 ++-
.../MobileCommentItem/MobileCommentItem.tsx | 72 ++++++++++++-------
2 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
index 5709dfdd..c8389e7c 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
@@ -53,12 +53,18 @@ export const createdTime = css({
export const commentTextWrapper = css({
...typo.Text.Regular,
- display: 'flex',
+ display: '-webkit-box',
width: '100%',
- paddingRight: '20px',
+ '-webkit-line-clamp': 3,
+ '-webkit-box-orient': 'vertical',
+ overflow: 'hidden',
color: color.BK,
});
+export const moreButtonWrapper = css({
+ float: 'right',
+});
+
export const commentBottomWrapper = css({
display: 'flex',
paddingRight: '15px',
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
index f542c39c..3a40e3e9 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
@@ -14,6 +14,8 @@ import TextArea from '@/components/molecules/TextArea/TextArea';
import CommentProfile from '@/components/atoms/CommentProfile/CommentProfile';
import useToastModal from '@/hooks/modal/useToastModal';
import useOutsideClick from '@/hooks/common/useOutsideClick';
+import MoreButton from '@/components/atoms/MoreButton/MoreButton';
+import { COMMENT } from '@/constants/message';
import * as S from './MobileCommentItem.style';
export interface CommentItemProps {
@@ -100,6 +102,17 @@ const MobileCommentItem = ({
// handleDelete();
// };
+ const [isExpanded, setIsExpanded] = useState(false);
+
+ const expandComment = () => {
+ setIsExpanded((prev) => !prev);
+ };
+
+ const isLongText = comment?.content.length > COMMENT.MAX_SHORTEN_LENGTH;
+ const shortenContent = isExpanded
+ ? comment?.content
+ : `${comment?.content.slice(0, COMMENT.MAX_SHORTEN_LENGTH)}...`;
+
const myComment: MenuItem[] = [
{
label: '수정',
@@ -163,7 +176,7 @@ const MobileCommentItem = ({
)}
- {editCommentClicked ? (
+ {/* {editCommentClicked ? (
- ) : (
- <>
- {comment?.content}
-
-
-
+ ) : ( */}
+
+ {shortenContent}
+ {isLongText && !isExpanded && (
+
+
- >
- )}
+ )}
+
+
+
+
+
+ {/* )} */}
From 622f2b40d3d9bcfa573fc69d13ac948a2fe7d641 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Fri, 21 Feb 2025 00:58:10 +0900
Subject: [PATCH 21/30] =?UTF-8?q?style:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?=
=?UTF-8?q?=ED=86=A1=ED=94=BD=20=EC=83=81=EC=84=B8=20=ED=8E=98=EC=9D=B4?=
=?UTF-8?q?=EC=A7=80=20=ED=95=98=EB=8B=A8=20=EB=A7=88=EC=A7=84=20=EC=B6=94?=
=?UTF-8?q?=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.style.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.style.ts b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.style.ts
index b360295a..db43055f 100644
--- a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.style.ts
+++ b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.style.ts
@@ -8,7 +8,7 @@ export const contentWrapStyle = css({
});
export const commentsWrapStyle = css({
- marginTop: '444px',
+ margin: '444px 0 90px',
borderTop: `10px solid ${color.GY[5]}`,
width: '100%',
});
From 877e0cf8bb3106aa45a12d8aca94331dee4c5e90 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Mon, 24 Feb 2025 21:00:09 +0900
Subject: [PATCH 22/30] =?UTF-8?q?feat:=20=EB=AA=A8=EB=B0=94=EC=9D=BC=20?=
=?UTF-8?q?=EB=8C=93=EA=B8=80=20=EC=88=98=EC=A0=95=20=EB=A1=9C=EC=A7=81=20?=
=?UTF-8?q?=EA=B5=AC=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../atoms/CommentInput/CommentInput.tsx | 2 +
.../MobileCommentItem/MobileCommentItem.tsx | 70 ++++---------------
.../MobileCommentsSection.tsx | 11 +--
src/hooks/comment/useCommentActions.ts | 21 +++++-
.../TalkPickMobilePage/TalkPickMobilePage.tsx | 68 ++++++++++++------
5 files changed, 84 insertions(+), 88 deletions(-)
diff --git a/src/components/mobile/atoms/CommentInput/CommentInput.tsx b/src/components/mobile/atoms/CommentInput/CommentInput.tsx
index fc09b18d..cba20076 100644
--- a/src/components/mobile/atoms/CommentInput/CommentInput.tsx
+++ b/src/components/mobile/atoms/CommentInput/CommentInput.tsx
@@ -5,12 +5,14 @@ import * as S from './CommentInput.style';
interface CommentInputProps {
comment: string;
+ isEditing: boolean;
onCommentChange: (value: string) => void;
onCommentSubmit: () => void;
}
const CommentInput = ({
comment,
+ isEditing,
onCommentChange,
onCommentSubmit,
...attributes
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
index 3a40e3e9..ab6a9746 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
-import React, { useEffect, useMemo, useRef, useState } from 'react';
+import React, { useMemo, useRef, useState } from 'react';
import { Comment } from '@/types/comment';
import { MobileComment } from '@/assets';
import { useMemberQuery } from '@/hooks/api/member/useMemberQuery';
@@ -10,10 +10,8 @@ import { useRepliesQuery } from '@/hooks/api/comment/useRepliesQuery';
import MenuTap, { MenuItem } from '@/components/atoms/MenuTap/MenuTap';
import CategoryBarChip from '@/components/atoms/CategoryBarChip/CategoryBarChip';
import LikeButton from '@/components/atoms/LikeButton/LikeButton';
-import TextArea from '@/components/molecules/TextArea/TextArea';
import CommentProfile from '@/components/atoms/CommentProfile/CommentProfile';
import useToastModal from '@/hooks/modal/useToastModal';
-import useOutsideClick from '@/hooks/common/useOutsideClick';
import MoreButton from '@/components/atoms/MoreButton/MoreButton';
import { COMMENT } from '@/constants/message';
import * as S from './MobileCommentItem.style';
@@ -24,6 +22,7 @@ export interface CommentItemProps {
comment: Comment;
selectedPage: number;
talkPickWriter: string;
+ onEditComment: (commentId: number, content: string) => void;
}
const MobileCommentItem = ({
@@ -32,6 +31,7 @@ const MobileCommentItem = ({
comment,
selectedPage,
talkPickWriter,
+ onEditComment,
}: CommentItemProps) => {
const { member } = useMemberQuery();
@@ -46,9 +46,12 @@ const MobileCommentItem = ({
const commentRef = useRef(null);
const { isVisible, modalText, showToastModal } = useToastModal();
- const [editCommentClicked, setEditCommentClicked] = useState(false);
- const [editCommentText, setEditCommentText] = useState(
+ const { handleDelete, handleLikeToggle, handleReport } = useCommentActions(
+ comment,
comment.content,
+ selectedPage,
+ () => {},
+ showToastModal,
);
const [activeModal, setActiveModal] = useState<
@@ -60,22 +63,6 @@ const MobileCommentItem = ({
};
const [visibleReply, setVisibleReply] = useState(10);
-
- const { handleEditSubmit, handleDelete, handleLikeToggle, handleReport } =
- useCommentActions(
- comment,
- editCommentText,
- selectedPage,
- setEditCommentClicked,
- showToastModal,
- );
-
- useEffect(() => {
- setEditCommentText(comment.content);
- }, [comment.content]);
-
- useOutsideClick(commentRef, () => setEditCommentClicked(false));
-
const [showReply, setShowReply] = useState(false);
const [replyValue, setReplyValue] = useState('');
@@ -97,11 +84,6 @@ const MobileCommentItem = ({
const { replies } = useRepliesQuery(comment.talkPickId, comment.id);
- // const handleDeleteCommentButton = () => {
- // onCloseModal();
- // handleDelete();
- // };
-
const [isExpanded, setIsExpanded] = useState(false);
const expandComment = () => {
@@ -117,7 +99,7 @@ const MobileCommentItem = ({
{
label: '수정',
onClick: () => {
- setEditCommentClicked(true);
+ onEditComment(comment.id, comment.content);
},
},
{
@@ -137,21 +119,9 @@ const MobileCommentItem = ({
},
];
- // const handleReportCommentButton = (reason: string) => {
- // handleReport(reason);
- // onCloseModal();
- // };
-
- // const handleMoreButton = () => {
- // setVisibleReply((reply) => reply + 10);
- // };
-
return (
-
-
+
+
첫댓글
)}
- {!editCommentClicked && (
-
- )}
+
- {/* {editCommentClicked ? (
-
);
};
+
export default MobileCommentItem;
diff --git a/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.tsx b/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.tsx
index 54da8e91..794243fb 100644
--- a/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.tsx
+++ b/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.tsx
@@ -16,6 +16,7 @@ export interface CommentsSectionProps {
commentList?: CommentsPagination;
selectedPage: number;
voted: boolean;
+ onEditComment: (commentId: number, content: string) => void;
}
const MobileCommentsSection = ({
@@ -24,6 +25,7 @@ const MobileCommentsSection = ({
commentList,
selectedPage,
voted,
+ onEditComment,
}: CommentsSectionProps) => {
const { member } = useMemberQuery();
const isMyTalkPick: boolean = talkPickWriter === member?.nickname;
@@ -62,19 +64,12 @@ const MobileCommentsSection = ({
comment={commentData}
selectedPage={selectedPage}
talkPickWriter={talkPickWriter}
+ onEditComment={onEditComment}
/>
))}
)}
- {/* */}
);
};
diff --git a/src/hooks/comment/useCommentActions.ts b/src/hooks/comment/useCommentActions.ts
index be130170..98f76837 100644
--- a/src/hooks/comment/useCommentActions.ts
+++ b/src/hooks/comment/useCommentActions.ts
@@ -1,3 +1,4 @@
+/* eslint-disable @typescript-eslint/no-unused-expressions */
import { Comment } from '@/types/comment';
import { useCreateLikeCommentMutation } from '@/hooks/api/like/useCreateLikeCommentMutation';
import { useDeleteLikeCommentMutation } from '@/hooks/api/like/useDeleteLikeCommentMutation';
@@ -6,14 +7,17 @@ import { useDeleteCommentMutation } from '@/hooks/api/comment/useDeleteCommentMu
import { useReportCommentMutation } from '@/hooks/api/report/useReportCommentMutation';
export const useCommentActions = (
- commentData: Comment,
+ commentData: Comment | null,
editText: string,
selectedPage: number,
setEditButtonClicked: (value: boolean) => void,
showToastModal: (message: string, callback?: () => void) => void,
parentId?: number,
) => {
- const { id, talkPickId, content, myLike } = commentData;
+ const id = commentData?.id ?? 0;
+ const talkPickId = commentData?.talkPickId ?? 0;
+ const content = commentData?.content ?? '';
+ const myLike = commentData?.myLike ?? false;
const { mutate: editComment } = useEditCommentMutation(
talkPickId,
@@ -53,6 +57,16 @@ export const useCommentActions = (
parentId,
);
+ // 🔹 commentData가 없을 경우 빈 함수 반환
+ if (!commentData) {
+ return {
+ handleEditSubmit: () => {},
+ handleDelete: () => {},
+ handleLikeToggle: () => {},
+ handleReport: () => {},
+ };
+ }
+
const handleEditSubmit = () => {
if (content === editText) return;
editComment({ content: editText });
@@ -62,8 +76,9 @@ export const useCommentActions = (
deleteComment();
};
- const handleLikeToggle = () =>
+ const handleLikeToggle = () => {
myLike ? deleteLikeComment() : createLikeComment();
+ };
return {
handleEditSubmit,
diff --git a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
index 0d564dbf..03b95a77 100644
--- a/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
+++ b/src/pages/mobile/TalkPickMobilePage/TalkPickMobilePage.tsx
@@ -2,12 +2,14 @@
import React, { useState } from 'react';
import { useLocation, useParams } from 'react-router-dom';
import MobileCommentsSection from '@/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection';
-// import { useMemberQuery } from '@/hooks/api/member/useMemberQuery';
import { useTalkPickDetailQuery } from '@/hooks/api/talk-pick/useTalkPickDetailQuery';
-// import { ToggleGroupItem } from '@/types/toggle';
import { useCommentsQuery } from '@/hooks/api/comment/useCommentsQuery';
import CommentInput from '@/components/mobile/atoms/CommentInput/CommentInput';
import { useCreateCommentMutation } from '@/hooks/api/comment/useCreateCommentMutation';
+import { useCommentActions } from '@/hooks/comment/useCommentActions';
+import useToastModal from '@/hooks/modal/useToastModal';
+import { Comment } from '@/types/comment';
+import { TalkPickDetail } from '@/types/talk-pick';
import * as S from './TalkPickMobilePage.style';
interface State {
@@ -18,41 +20,64 @@ interface State {
const TalkPickMobilePage = () => {
const [currentPage, setCurrentPage] = useState(1);
const [comment, setComment] = useState('');
-
- // const { member } = useMemberQuery();
-
+ const [editCommentId, setEditCommentId] = useState(null);
+ const [editCommentText, setEditCommentText] = useState('');
const { talkPickId } = useParams();
const location = useLocation();
const state = location.state as State;
const id = state?.talkPickId ?? Number(talkPickId);
- // const isTodayTalkPick = state?.isTodayTalkPick;
-
const { talkPick } = useTalkPickDetailQuery(id);
const { mutate: createComment } = useCreateCommentMutation(id, currentPage);
+ const { isVisible, modalText, showToastModal } = useToastModal();
+
+ const { comments } = useCommentsQuery(
+ id,
+ { page: currentPage - 1, size: 7 },
+ 'comments',
+ );
+
+ const selectedComment =
+ comments?.content.find((c) => c.id === editCommentId) || null;
+
+ const commentActions = useCommentActions(
+ selectedComment,
+ editCommentText,
+ currentPage,
+ () => setEditCommentId(null),
+ showToastModal,
+ );
const handleCommentPageChange = (newPage: number) => {
setCurrentPage(newPage);
};
const handleCommentChange = (value: string) => {
- setComment(value);
+ if (editCommentId) {
+ setEditCommentText(value);
+ } else {
+ setComment(value);
+ }
};
- const handleCommentSubmit = () => {
- setComment('');
- createComment({ content: comment });
+ const handleEditComment = (commentId: number, content: string) => {
+ setEditCommentId(commentId);
+ setEditCommentText(content);
};
- const { comments } = useCommentsQuery(
- id,
- {
- page: currentPage - 1,
- size: 7,
- },
- 'comments',
- );
+ const handleEditSubmit = commentActions?.handleEditSubmit ?? (() => {});
+
+ const handleCommentSubmit = () => {
+ if (editCommentId && selectedComment) {
+ handleEditSubmit();
+ setEditCommentId(null);
+ setEditCommentText('');
+ } else {
+ createComment({ content: comment });
+ setComment('');
+ }
+ };
return (
@@ -63,14 +88,17 @@ const TalkPickMobilePage = () => {
commentList={comments}
selectedPage={currentPage}
voted={talkPick?.votedOption !== null}
+ onEditComment={handleEditComment}
/>
);
};
+
export default TalkPickMobilePage;
From 00104106ba0395f07bfc272d0957ec36a99fc59e Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Mon, 24 Feb 2025 21:00:35 +0900
Subject: [PATCH 23/30] =?UTF-8?q?refactor:=20=EB=B3=B8=EC=9D=B8=20?=
=?UTF-8?q?=EB=8C=93=EA=B8=80=EC=9D=BC=20=EB=95=8C=EC=9D=98=20=EB=B0=B0?=
=?UTF-8?q?=EA=B2=BD=20=EA=B4=80=EB=A0=A8=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../molecules/MobileCommentItem/MobileCommentItem.style.ts | 1 +
.../MobileCommentsSection/MobileCommentsSection.style.ts | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
index c8389e7c..d06c4b2f 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
@@ -16,6 +16,7 @@ export const commentContainer = css({
alignItems: 'flex-start',
width: '100%',
gap: '8px',
+ padding: '10px 11px 14px 20px',
});
export const profileWrapper = css({
diff --git a/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.style.ts b/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.style.ts
index 114ea7f1..69f4f1dc 100644
--- a/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.style.ts
+++ b/src/components/mobile/organisms/MobileCommentsSection/MobileCommentsSection.style.ts
@@ -7,7 +7,6 @@ export const commentsSectionContainer = css({
flexDirection: 'column',
paddingTop: '13px',
// paddingBottom: '85px',
- margin: '0 11px 0 20px',
backgroundColor: color.WT,
overflowY: 'auto',
gap: '10px',
@@ -15,6 +14,7 @@ export const commentsSectionContainer = css({
export const commentTopWrapper = css(typo.Mobile.Text.SemiBold_14, {
display: 'flex',
+ margin: '0 11px 0 20px',
alignItems: 'flex-start',
color: color.GY[7],
});
From d34d2e2f23166151c2e16dff7c661201b6c335ff Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Mon, 24 Feb 2025 21:19:04 +0900
Subject: [PATCH 24/30] =?UTF-8?q?refactor:=20=EB=8C=93=EA=B8=80=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95=20=EA=B4=80=EB=A0=A8=20=EC=83=81=ED=83=9C=20?=
=?UTF-8?q?props=20=EC=B6=94=EA=B0=80=20=EB=B0=8F=20=EC=A3=BC=EC=84=9D=20?=
=?UTF-8?q?=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/stories/mobile/atoms/CommentInput.stories.tsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/stories/mobile/atoms/CommentInput.stories.tsx b/src/stories/mobile/atoms/CommentInput.stories.tsx
index 6f4a84fc..230c7b8e 100644
--- a/src/stories/mobile/atoms/CommentInput.stories.tsx
+++ b/src/stories/mobile/atoms/CommentInput.stories.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
import React from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { storyContainer, storyInnerContainer } from '@/stories/story.styles';
@@ -27,16 +26,19 @@ export const All: Story = {
comment=""
onCommentChange={() => {}}
onCommentSubmit={() => {}}
+ isEditing={false}
/>
{}}
onCommentSubmit={() => {}}
+ isEditing={false}
/>
{}}
onCommentSubmit={() => {}}
+ isEditing={false}
/>
From e867d3ef89842520f9274cd58888a36b65f8e5d8 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Wed, 5 Mar 2025 14:00:41 +0900
Subject: [PATCH 25/30] =?UTF-8?q?refactor:=20=ED=98=84=EC=9E=AC=20?=
=?UTF-8?q?=EA=B5=AC=ED=98=84=EB=90=98=EC=A7=80=20=EC=95=8A=EC=9D=80=20?=
=?UTF-8?q?=EB=8B=B5=EA=B8=80=20=EB=B6=80=EB=B6=84=20=ED=95=A8=EC=88=98=20?=
=?UTF-8?q?=EB=B0=8F=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MobileCommentItem/MobileCommentItem.tsx | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
index ab6a9746..d176e91b 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
@@ -64,26 +64,12 @@ const MobileCommentItem = ({
const [visibleReply, setVisibleReply] = useState(10);
const [showReply, setShowReply] = useState(false);
- const [replyValue, setReplyValue] = useState('');
const handleReplyToggle = () => {
setShowReply(!showReply);
setVisibleReply(10);
};
- const { mutate: createReply } = useCreateReplyMutation(
- comment.talkPickId,
- comment.id,
- selectedPage,
- );
-
- const handleReplyButton = () => {
- createReply({ content: replyValue });
- setReplyValue('');
- };
-
- const { replies } = useRepliesQuery(comment.talkPickId, comment.id);
-
const [isExpanded, setIsExpanded] = useState(false);
const expandComment = () => {
From 624870f796534d1267c17b836f6d2747ae7a0d80 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 6 Mar 2025 01:31:57 +0900
Subject: [PATCH 26/30] =?UTF-8?q?feat:=20MobileReportModal=20=EC=BB=B4?=
=?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20UI=20=EB=B0=8F=20=EC=8A=A4?=
=?UTF-8?q?=ED=86=A0=EB=A6=AC=EB=B6=81=20=EA=B5=AC=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/index.ts | 1 +
src/assets/svg/mobile-report.svg | 9 +++
.../MobileReportModal.style.ts | 68 ++++++++++++++++
.../MobileReportModal/MobileReportModal.tsx | 77 +++++++++++++++++++
.../molecules/MobileReportModal.stories.tsx | 23 ++++++
5 files changed, 178 insertions(+)
create mode 100644 src/assets/svg/mobile-report.svg
create mode 100644 src/components/mobile/molecules/MobileReportModal/MobileReportModal.style.ts
create mode 100644 src/components/mobile/molecules/MobileReportModal/MobileReportModal.tsx
create mode 100644 src/stories/mobile/molecules/MobileReportModal.stories.tsx
diff --git a/src/assets/index.ts b/src/assets/index.ts
index db9d8d2e..b36aec0c 100644
--- a/src/assets/index.ts
+++ b/src/assets/index.ts
@@ -157,6 +157,7 @@ export { default as MobileLikeButtonDF } from './svg/mobile-like-button-df.svg';
export { default as MobileLikeButtonPR } from './svg/mobile-like-button-pr.svg';
export { default as MobileArrowUp } from './svg/mobile-arrow-up.svg';
export { default as MobileArrowDown } from './svg/mobile-arrow-down.svg';
+export { default as MobileReport } from './svg/mobile-report.svg';
// TODO: 이전 SVG
export { default as Email } from './svg/email.svg';
diff --git a/src/assets/svg/mobile-report.svg b/src/assets/svg/mobile-report.svg
new file mode 100644
index 00000000..abb54466
--- /dev/null
+++ b/src/assets/svg/mobile-report.svg
@@ -0,0 +1,9 @@
+
diff --git a/src/components/mobile/molecules/MobileReportModal/MobileReportModal.style.ts b/src/components/mobile/molecules/MobileReportModal/MobileReportModal.style.ts
new file mode 100644
index 00000000..c223fb7d
--- /dev/null
+++ b/src/components/mobile/molecules/MobileReportModal/MobileReportModal.style.ts
@@ -0,0 +1,68 @@
+import { css } from '@emotion/react';
+import color from '@/styles/color';
+import typo from '@/styles/typo';
+
+export const reportModalStyling = css({
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ width: '100%',
+});
+
+export const titleContainer = css({
+ display: 'flex',
+ flexDirection: 'column',
+ alignItems: 'center',
+ justifyContent: 'center',
+ gap: '6px',
+});
+
+export const titleStyle = css(typo.Main.SemiBold, {});
+
+export const getButtonContainer = (inputVisible: boolean) =>
+ css({
+ display: 'grid',
+ gridTemplateColumns: 'repeat(2, 1fr)',
+ gap: '7px',
+ margin: `18px 0 ${inputVisible ? '14px' : '22px'} 0`,
+ });
+
+export const reasonButton = css(typo.Mobile.Text.SemiBold_14, {
+ padding: '14px 16px',
+ display: 'flex',
+ justifyContent: 'flex-start',
+ border: 'none',
+ borderRadius: '8px',
+ backgroundColor: color.GY[5],
+ cursor: 'pointer',
+ color: color.GY[6],
+ ':hover': {
+ backgroundColor: color.WT_VIOLET,
+ border: `1.6px solid ${color.MAIN}`,
+ color: color.MAIN,
+ },
+});
+
+export const reportInputStyling = css(typo.Mobile.Text.SemiBold_14, {
+ width: '100%',
+ paddingBottom: '6px',
+ borderBottom: `1px solid ${color.GY[4]}`,
+ marginBottom: '20px',
+ color: color.BK,
+ '::placeholder': {
+ color: color.GY[6],
+ },
+});
+
+export const submitButton = css(typo.Comment.SemiBold, {
+ width: '100%',
+ padding: '9px 118.5px',
+ border: 'none',
+ borderRadius: '12px',
+ backgroundColor: color.MAIN,
+ color: color.WT,
+ cursor: 'pointer',
+ ':disabled': {
+ backgroundColor: color.GY[4],
+ },
+});
diff --git a/src/components/mobile/molecules/MobileReportModal/MobileReportModal.tsx b/src/components/mobile/molecules/MobileReportModal/MobileReportModal.tsx
new file mode 100644
index 00000000..9c11fa93
--- /dev/null
+++ b/src/components/mobile/molecules/MobileReportModal/MobileReportModal.tsx
@@ -0,0 +1,77 @@
+import { MobileReport } from '@/assets';
+import Modal from '@/components/mobile/atoms/Modal/Modal';
+import React, { useState } from 'react';
+import { reportOptions } from '@/constants/reportOption';
+import * as S from './MobileReportModal.style';
+
+interface MobileReportModalProps {
+ isOpen: boolean;
+ onConfirm?: (reason: string) => void;
+ onClose: () => void;
+}
+
+export const MobileReportModal = ({
+ isOpen,
+ onConfirm,
+ onClose,
+}: MobileReportModalProps) => {
+ const [reportReason, setReportReason] = useState('');
+ const [otherReason, setOtherReason] = useState('');
+ const finalReportReason: string =
+ reportReason === '기타' ? otherReason : reportReason;
+
+ const handleReportReason = (e: React.MouseEvent) => {
+ setReportReason(e.currentTarget.value);
+ };
+
+ const handleOtherReportReason = (e: React.ChangeEvent) => {
+ setOtherReason(e.target.value);
+ };
+
+ const handleConfirm = () => {
+ if (!finalReportReason.trim()) return;
+ onConfirm?.(finalReportReason);
+ };
+
+ return (
+
+
+
+
+
신고사유 선택
+
+
+
+ {reportOptions.map((option) => (
+
+ ))}
+
+
+ {reportReason === '기타' && (
+
+ )}
+
+
+
+
+ );
+};
diff --git a/src/stories/mobile/molecules/MobileReportModal.stories.tsx b/src/stories/mobile/molecules/MobileReportModal.stories.tsx
new file mode 100644
index 00000000..b034a33b
--- /dev/null
+++ b/src/stories/mobile/molecules/MobileReportModal.stories.tsx
@@ -0,0 +1,23 @@
+import { MobileReportModal } from '@/components/mobile/molecules/MobileReportModal/MobileReportModal';
+import type { Meta, StoryObj } from '@storybook/react';
+
+const meta = {
+ title: 'mobile/molecules/MobileReportModal',
+ component: MobileReportModal,
+ parameters: {
+ layout: 'centered',
+ },
+ argTypes: {
+ isOpen: { control: { type: 'boolean' } },
+ },
+ args: {
+ isOpen: true,
+ onConfirm: () => {},
+ onClose: () => {},
+ },
+} satisfies Meta;
+
+export default meta;
+type Story = StoryObj;
+
+export const Default: Story = {};
From 5acd01d89cc054d2d6cfb071f4649ddefbaeaaa8 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 6 Mar 2025 01:32:20 +0900
Subject: [PATCH 27/30] =?UTF-8?q?feat:=20MobileReportModal=EC=97=90=20?=
=?UTF-8?q?=EB=8C=80=ED=95=9C=20ModalProps=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/mobile/atoms/Modal/Modal.style.ts | 3 +++
src/components/mobile/atoms/Modal/Modal.tsx | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/components/mobile/atoms/Modal/Modal.style.ts b/src/components/mobile/atoms/Modal/Modal.style.ts
index bd68bb4b..c628c8b1 100644
--- a/src/components/mobile/atoms/Modal/Modal.style.ts
+++ b/src/components/mobile/atoms/Modal/Modal.style.ts
@@ -27,6 +27,9 @@ export const getModalSize = (action: Required['action']) => {
tempGame: css({
padding: '24px 20px',
}),
+ report: css({
+ padding: '33px 21px 20px 21px',
+ }),
};
return style[action];
diff --git a/src/components/mobile/atoms/Modal/Modal.tsx b/src/components/mobile/atoms/Modal/Modal.tsx
index ac8f5d1c..0b7f3657 100644
--- a/src/components/mobile/atoms/Modal/Modal.tsx
+++ b/src/components/mobile/atoms/Modal/Modal.tsx
@@ -5,7 +5,7 @@ import useOutsideClick from '@/hooks/common/useOutsideClick';
import * as S from './Modal.style';
export interface ModalProps {
- action?: 'text' | 'share' | 'tag' | 'tempGame';
+ action?: 'text' | 'share' | 'tag' | 'tempGame' | 'report';
isOpen?: boolean;
onClose?: () => void;
hasCloseButton?: boolean;
From 3d054b5617a71c3bf6d229cdead32f28733a9804 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 6 Mar 2025 01:32:57 +0900
Subject: [PATCH 28/30] =?UTF-8?q?feat:=20MobileReportModal=20=EB=AA=A8?=
=?UTF-8?q?=EB=B0=94=EC=9D=BC=20=EB=8C=93=EA=B8=80=EC=97=90=20=EB=A1=9C?=
=?UTF-8?q?=EC=A7=81=20=EA=B5=AC=ED=98=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../MobileCommentItem.style.ts | 8 +
.../MobileCommentItem/MobileCommentItem.tsx | 168 +++++++++---------
2 files changed, 94 insertions(+), 82 deletions(-)
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
index d06c4b2f..de8adf98 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.style.ts
@@ -81,3 +81,11 @@ export const replyButton = css({
color: color.GY[1],
padding: 0,
});
+
+export const centerStyling = css({
+ position: 'fixed',
+ top: '50%',
+ left: '50%',
+ transform: 'translate(-50%, -50%)',
+ zIndex: 1000,
+});
diff --git a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
index d176e91b..f99b6a8f 100644
--- a/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
+++ b/src/components/mobile/molecules/MobileCommentItem/MobileCommentItem.tsx
@@ -1,12 +1,11 @@
-/* eslint-disable @typescript-eslint/no-unused-vars */
import React, { useMemo, useRef, useState } from 'react';
import { Comment } from '@/types/comment';
import { MobileComment } from '@/assets';
import { useMemberQuery } from '@/hooks/api/member/useMemberQuery';
import { formatDateFromISOWithTime } from '@/utils/formatData';
import { useCommentActions } from '@/hooks/comment/useCommentActions';
-import { useCreateReplyMutation } from '@/hooks/api/comment/useCreateReplyMutation';
-import { useRepliesQuery } from '@/hooks/api/comment/useRepliesQuery';
+// import { useCreateReplyMutation } from '@/hooks/api/comment/useCreateReplyMutation';
+// import { useRepliesQuery } from '@/hooks/api/comment/useRepliesQuery';
import MenuTap, { MenuItem } from '@/components/atoms/MenuTap/MenuTap';
import CategoryBarChip from '@/components/atoms/CategoryBarChip/CategoryBarChip';
import LikeButton from '@/components/atoms/LikeButton/LikeButton';
@@ -14,6 +13,7 @@ import CommentProfile from '@/components/atoms/CommentProfile/CommentProfile';
import useToastModal from '@/hooks/modal/useToastModal';
import MoreButton from '@/components/atoms/MoreButton/MoreButton';
import { COMMENT } from '@/constants/message';
+import { MobileReportModal } from '@/components/mobile/molecules/MobileReportModal/MobileReportModal';
import * as S from './MobileCommentItem.style';
export interface CommentItemProps {
@@ -34,17 +34,8 @@ const MobileCommentItem = ({
onEditComment,
}: CommentItemProps) => {
const { member } = useMemberQuery();
-
- const isMyComment = useMemo(() => {
- return comment?.nickname === member?.nickname;
- }, [comment?.nickname, member?.nickname]);
-
- const isTalkPickWriter = useMemo(() => {
- return comment?.nickname === talkPickWriter;
- }, [comment?.nickname, talkPickWriter]);
-
const commentRef = useRef(null);
- const { isVisible, modalText, showToastModal } = useToastModal();
+ const { showToastModal } = useToastModal();
const { handleDelete, handleLikeToggle, handleReport } = useCommentActions(
comment,
@@ -54,33 +45,37 @@ const MobileCommentItem = ({
showToastModal,
);
- const [activeModal, setActiveModal] = useState<
- 'reportComment' | 'reportText' | 'deleteText' | 'none'
- >('none');
+ const isMyComment = useMemo(() => {
+ return comment?.nickname === member?.nickname;
+ }, [comment?.nickname, member?.nickname]);
- const onCloseModal = () => {
- setActiveModal('none');
- };
+ const isTalkPickWriter = useMemo(() => {
+ return comment?.nickname === talkPickWriter;
+ }, [comment?.nickname, talkPickWriter]);
- const [visibleReply, setVisibleReply] = useState(10);
const [showReply, setShowReply] = useState(false);
const handleReplyToggle = () => {
setShowReply(!showReply);
- setVisibleReply(10);
};
const [isExpanded, setIsExpanded] = useState(false);
-
- const expandComment = () => {
- setIsExpanded((prev) => !prev);
- };
+ const expandComment = () => setIsExpanded((prev) => !prev);
const isLongText = comment?.content.length > COMMENT.MAX_SHORTEN_LENGTH;
const shortenContent = isExpanded
? comment?.content
: `${comment?.content.slice(0, COMMENT.MAX_SHORTEN_LENGTH)}...`;
+ const [isReportModalOpen, setIsReportModalOpen] = useState(false);
+ const openReportModal = () => setIsReportModalOpen(true);
+ const closeReportModal = () => setIsReportModalOpen(false);
+
+ const handleReportCommentButton = (reason: string) => {
+ handleReport(reason);
+ closeReportModal();
+ };
+
const myComment: MenuItem[] = [
{
label: '수정',
@@ -90,79 +85,88 @@ const MobileCommentItem = ({
},
{
label: '삭제',
- onClick: () => {
- setActiveModal('deleteText');
- },
+ onClick: () => handleDelete(),
},
];
const reportComment: MenuItem[] = [
{
label: '신고',
- onClick: () => {
- setActiveModal('reportText');
- },
+ onClick: () => openReportModal(),
},
];
return (
-
-
-
-
-
-
-
-
- {comment?.nickname}
-
- {formatDateFromISOWithTime(comment?.createdAt ?? '')}
-
- {isTalkPickWriter && (
- 작성자
- )}
- {idx === 0 && totalElements === 1 && (
- 첫댓글
- )}
-
-
+ <>
+
+
+
+
-
- {shortenContent}
- {isLongText && !isExpanded && (
-
-
+
+
+
+ {comment?.nickname}
+
+ {formatDateFromISOWithTime(comment?.createdAt ?? '')}
+
+ {isTalkPickWriter && (
+ 작성자
+ )}
+ {idx === 0 && totalElements === 1 && (
+ 첫댓글
+ )}
- )}
-
-
-
-
+
+ {shortenContent}
+ {isLongText && !isExpanded && (
+
+
+
)}
-
+
+
+
+
+
-
+
+ handleReportCommentButton(reason)}
+ onClose={closeReportModal}
+ />
+
+ >
);
};
From 878f419c0558eea557c96cd535e41ea951d2b28b Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 6 Mar 2025 01:40:46 +0900
Subject: [PATCH 29/30] =?UTF-8?q?refactor:=20MobileReport=20=EC=95=84?=
=?UTF-8?q?=EC=9D=B4=EC=BD=98=20=EC=A0=95=EC=9D=98=20=EC=A4=91=EB=B3=B5=20?=
=?UTF-8?q?=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/assets/index.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/assets/index.ts b/src/assets/index.ts
index 904e2c62..e5efb086 100644
--- a/src/assets/index.ts
+++ b/src/assets/index.ts
@@ -158,7 +158,6 @@ export { default as MobileLikeButtonPR } from './svg/mobile-like-button-pr.svg';
export { default as MobileArrowUp } from './svg/mobile-arrow-up.svg';
export { default as MobileArrowDown } from './svg/mobile-arrow-down.svg';
export { default as MobileReport } from './svg/mobile-report.svg';
-export { default as MobileReport } from './svg/mobile-report.svg';
export { default as PickIcon } from './svg/pick-icon.svg';
// TODO: 이전 SVG
From c8fe3328791b084cf3eead2b615bbce54f5f0e06 Mon Sep 17 00:00:00 2001
From: Yoobin Seo <135022491+alwubin@users.noreply.github.com>
Date: Thu, 6 Mar 2025 02:06:11 +0900
Subject: [PATCH 30/30] =?UTF-8?q?refactor:=20=EC=83=81=EC=88=98=20?=
=?UTF-8?q?=EA=B0=9D=EC=B2=B4=20=EA=B4=84=ED=98=B8=20=EC=98=A4=EB=A5=98=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/constants/message.ts | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/constants/message.ts b/src/constants/message.ts
index a478e656..c95e8059 100644
--- a/src/constants/message.ts
+++ b/src/constants/message.ts
@@ -223,6 +223,7 @@ export const COMMENT = {
FIRST_COMMENT_SUGGESTION: '첫 댓글을 달아보는건 어때요?',
MAX_LENGTH: 500,
MAX_SHORTEN_LENGTH: 90,
+};
export const PROMPT = {
POST: {