From 13a693a0bcc031fbc2745ac436d88c3ea5d06f2d Mon Sep 17 00:00:00 2001 From: Vishnu Date: Thu, 22 May 2025 15:41:28 +0530 Subject: [PATCH 1/6] feat: add ThreadChat component with message handling and UI interactions --- .../ui/collaboration/CommentThreads.tsx | 8 +- .../components/ui/collaboration/Messages.tsx | 80 +++++++++++++++++++ .../ui/collaboration/ThreadChat.tsx | 63 +++++++++++++++ app/src/pages/Project.tsx | 2 - app/src/styles/scene/comments.scss | 18 ++++- 5 files changed, 161 insertions(+), 10 deletions(-) create mode 100644 app/src/components/ui/collaboration/Messages.tsx create mode 100644 app/src/components/ui/collaboration/ThreadChat.tsx diff --git a/app/src/components/ui/collaboration/CommentThreads.tsx b/app/src/components/ui/collaboration/CommentThreads.tsx index 82cd6fb..67554ce 100644 --- a/app/src/components/ui/collaboration/CommentThreads.tsx +++ b/app/src/components/ui/collaboration/CommentThreads.tsx @@ -28,7 +28,9 @@ const CommentThreads: React.FC = () => { onPointerEnter={() => getDetails()} onPointerLeave={() => getDetails()} onClick={() => getDetails("clicked")} - className={`comments-threads-container ${expand ? "open" : "closed"}`} + className={`comments-threads-container ${ + expand ? "open" : "closed" + } unread`} >
{commentsedUsers.map((val, i) => ( @@ -41,9 +43,7 @@ const CommentThreads: React.FC = () => {
))} -
+
user
4 mins, ago
diff --git a/app/src/components/ui/collaboration/Messages.tsx b/app/src/components/ui/collaboration/Messages.tsx new file mode 100644 index 0000000..b0bfae4 --- /dev/null +++ b/app/src/components/ui/collaboration/Messages.tsx @@ -0,0 +1,80 @@ +import React, { useState } from "react"; +import { getAvatarColor } from "../../../modules/collaboration/functions/getAvatarColor"; +import { KebabIcon } from "../../icons/ExportCommonIcons"; + +interface MessageProps { + val: { + userName: string; + userId: string; + message: string; + creationTime: string; + idEdited: boolean; + modifiedTime: string; + }; + i: number; +} + +const Messages: React.FC = ({ val, i }) => { + const [isEditing, setIsEditing] = useState(false); + const [openOptions, setOpenOptions] = useState(false); + const currentUser = "1"; + return ( + <> + {isEditing ? ( + <> +
+ {val.userName[0]} +
+
+
+
{val.userName}
+
{val.creationTime}
+
+ {val.userId === currentUser && ( +
+ + {openOptions && ( +
+ + +
+ )} +
+ )} +
+ + ) : ( +
+
+