From 43adb0137a84eb45715feacce32c273ae9eb45d4 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Thu, 22 May 2025 18:29:27 +0530 Subject: [PATCH] feat: implement ThreadChat component and enhance Messages and CommentThreads with improved structure and styling --- .../ui/collaboration/CommentThreads.tsx | 32 +++++---- .../components/ui/collaboration/Messages.tsx | 27 ++++---- .../ui/collaboration/ThreadChat.tsx | 44 ++++++++----- app/src/pages/Project.tsx | 2 + app/src/styles/scene/comments.scss | 66 +++++++++++++++++++ 5 files changed, 126 insertions(+), 45 deletions(-) diff --git a/app/src/components/ui/collaboration/CommentThreads.tsx b/app/src/components/ui/collaboration/CommentThreads.tsx index ed8d563..0ce9fad 100644 --- a/app/src/components/ui/collaboration/CommentThreads.tsx +++ b/app/src/components/ui/collaboration/CommentThreads.tsx @@ -18,19 +18,19 @@ const CommentThreads: React.FC = ({ commentClicked }) => { lastUpdatedAt: "string", replies: [ { - replyId: 'string', - creatorId: 'string', - createdAt: 'string', - lastUpdatedAt: 'string', - reply: 'string', + replyId: "string", + creatorId: "string", + createdAt: "string", + lastUpdatedAt: "string", + reply: "string", }, { - replyId: 'string', - creatorId: 'string', - createdAt: 'string', - lastUpdatedAt: 'string', - reply: 'string', - } + replyId: "string", + creatorId: "string", + createdAt: "string", + lastUpdatedAt: "string", + reply: "string", + }, ], }; @@ -54,8 +54,9 @@ const CommentThreads: React.FC = ({ commentClicked }) => { onPointerEnter={() => getDetails()} onPointerLeave={() => getDetails()} onClick={() => getDetails("clicked")} - className={`comments-threads-container ${expand ? "open" : "closed" - } unread`} + className={`comments-threads-container ${ + expand ? "open" : "closed" + } unread`} >
{commentsedUsers.map((val, i) => ( @@ -79,7 +80,10 @@ const CommentThreads: React.FC = ({ commentClicked }) => {
{CommentDetails.comment}
{CommentDetails.replies.length > 0 && ( -
{CommentDetails.replies.length} reply(s)
+
+ {CommentDetails.replies.length}{" "} + {CommentDetails.replies.length === 1 ? "reply" : "replies"} +
)} diff --git a/app/src/components/ui/collaboration/Messages.tsx b/app/src/components/ui/collaboration/Messages.tsx index 69f9669..3440204 100644 --- a/app/src/components/ui/collaboration/Messages.tsx +++ b/app/src/components/ui/collaboration/Messages.tsx @@ -17,7 +17,19 @@ const Messages: React.FC = ({ val, i }) => { return ( <> {isEditing ? ( - <> +
+
+