Merge remote-tracking branch 'origin/v2-ui' into v2

This commit is contained in:
Jerald-Golden-B 2025-05-22 16:37:17 +05:30
commit e8524cffd6
3 changed files with 36 additions and 23 deletions

View File

@ -3,16 +3,23 @@ import { getAvatarColor } from "../../../modules/collaboration/functions/getAvat
const CommentThreads: React.FC = () => { const CommentThreads: React.FC = () => {
const [expand, setExpand] = useState(false); const [expand, setExpand] = useState(false);
const commentsedUsers = [ const commentsedUsers = [{ creatorId: "1" }];
{
userId: "1", const CommentDetails = {
userName: "user", state: "active",
}, commentId: "c-1",
{ creatorId: "12",
userId: "2", createdAt: "2 hours ago",
userName: "Admin", comment: "Thread check",
}, lastUpdatedAt: "string",
]; replies: [],
};
function getUsername(userId: string) {
console.log(userId);
const UserName = "username";
return UserName;
}
function getDetails(type?: "clicked") { function getDetails(type?: "clicked") {
if (type === "clicked") { if (type === "clicked") {
@ -36,20 +43,26 @@ const CommentThreads: React.FC = () => {
{commentsedUsers.map((val, i) => ( {commentsedUsers.map((val, i) => (
<div <div
className="users" className="users"
key={val.userId} key={val.creatorId}
style={{ background: getAvatarColor(i, val.userName) }} style={{
background: getAvatarColor(i, getUsername(val.creatorId)),
}}
> >
{val.userName[0]} {getUsername(val.creatorId)[0]}
</div> </div>
))} ))}
</div> </div>
<div className={`last-comment-details ${expand ? "expand" : ""}`}> <div className={`last-comment-details ${expand ? "expand" : ""}`}>
<div className="header"> <div className="header">
<div className="user-name">user</div> <div className="user-name">
<div className="time">4 mins, ago</div> {getUsername(CommentDetails.creatorId)}
</div>
<div className="time">{CommentDetails.createdAt}</div>
</div> </div>
<div className="message">hello</div> <div className="message">{CommentDetails.comment}</div>
<div className="replies">0 replies</div> {CommentDetails.replies.length > 0 && (
<div className="replies">{CommentDetails.replies.length}</div>
)}
</div> </div>
</button> </button>
</div> </div>

View File

@ -1,22 +1,22 @@
@use "../abstracts/variables" as *; @use "../abstracts/variables" as *;
@use "../abstracts/mixins" as *; @use "../abstracts/mixins" as *;
.comments-main-wrapper{ .comments-main-wrapper {
position: relative; position: relative;
} }
.comments-threads-wrapper { .comments-threads-wrapper {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
padding: 4px; padding: 4px;
background: var(--background-color); background: var(--background-color);
border-radius: #{$border-radius-large} #{$border-radius-large} #{$border-radius-large} border-radius: #{$border-radius-extra-large} #{$border-radius-extra-large} #{$border-radius-extra-large}
0; 0;
backdrop-filter: blur(12px); backdrop-filter: blur(12px);
z-index: 1000; z-index: 1000;
transform: translateY(-100%); transform: translateY(-100%);
outline: 1px solid var(--border-color); outline: 1px solid var(--border-color);
transition: all 0.2s ease-out;
.comments-threads-container { .comments-threads-container {
display: flex; display: flex;
align-items: start; align-items: start;
@ -36,7 +36,7 @@
align-items: start; align-items: start;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
transition: all 0.2s; transition: all 0.2s ease-in;
.header { .header {
@include flex-center; @include flex-center;
gap: 10px; gap: 10px;

View File

@ -10,7 +10,7 @@ interface CommentSchema {
replies: Reply[]; replies: Reply[];
} }
interface Reply { export interface Reply {
replyId: string; replyId: string;
creatorId: string; creatorId: string;
createdAt: string; createdAt: string;
@ -18,4 +18,4 @@ interface Reply {
reply: string; reply: string;
} }
type CommentsSchema = CommentSchema[]; type CommentsSchema = CommentSchema[];