feat: update CommentThreads component and integrate it into CommentInstance
This commit is contained in:
parent
56363a0370
commit
b6aa4ab632
|
@ -2,14 +2,14 @@ import React, { useState } from "react";
|
||||||
import { getAvatarColor } from "../../../modules/collaboration/functions/getAvatarColor";
|
import { getAvatarColor } from "../../../modules/collaboration/functions/getAvatarColor";
|
||||||
|
|
||||||
const CommentThreads: React.FC = () => {
|
const CommentThreads: React.FC = () => {
|
||||||
const [expand, setExpand] = useState(true);
|
const [expand, setExpand] = useState(false);
|
||||||
const commentsedUsers = [
|
const commentsedUsers = [
|
||||||
{
|
{
|
||||||
userId: "1",
|
userId: "1",
|
||||||
userName: "user",
|
userName: "user",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
userId: "1",
|
userId: "2",
|
||||||
userName: "Admin",
|
userName: "Admin",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { Html, TransformControls } from '@react-three/drei';
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useEffect, useRef, useState } from 'react'
|
||||||
import { usePlayButtonStore } from '../../../../../store/usePlayButtonStore';
|
import { usePlayButtonStore } from '../../../../../store/usePlayButtonStore';
|
||||||
import { detectModifierKeys } from '../../../../../utils/shortcutkeys/detectModifierKeys';
|
import { detectModifierKeys } from '../../../../../utils/shortcutkeys/detectModifierKeys';
|
||||||
|
import CommentThreads from '../../../../../components/ui/collaboration/CommentThreads';
|
||||||
|
|
||||||
function CommentInstance({ comment }: { comment: CommentSchema }) {
|
function CommentInstance({ comment }: { comment: CommentSchema }) {
|
||||||
const { isPlaying } = usePlayButtonStore();
|
const { isPlaying } = usePlayButtonStore();
|
||||||
|
@ -38,9 +39,10 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
||||||
center
|
center
|
||||||
position={comment.position}
|
position={comment.position}
|
||||||
rotation={comment.rotation}
|
rotation={comment.rotation}
|
||||||
|
className='comments-main-wrapper'
|
||||||
>
|
>
|
||||||
|
<CommentThreads />
|
||||||
<div
|
{/* <div
|
||||||
className='outer'
|
className='outer'
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -53,7 +55,7 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
||||||
<div>
|
<div>
|
||||||
hii
|
hii
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</Html>
|
</Html>
|
||||||
{CommentRef.current && transformMode && (
|
{CommentRef.current && transformMode && (
|
||||||
<TransformControls
|
<TransformControls
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
@use "../abstracts/variables" as *;
|
@use "../abstracts/variables" as *;
|
||||||
@use "../abstracts/mixins" as *;
|
@use "../abstracts/mixins" as *;
|
||||||
|
|
||||||
|
.comments-main-wrapper{
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
.comments-threads-wrapper {
|
.comments-threads-wrapper {
|
||||||
position: fixed;
|
position: absolute;
|
||||||
top: 50%;
|
top: 0;
|
||||||
left: 50%;
|
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-large} #{$border-radius-large} #{$border-radius-large}
|
||||||
|
|
Loading…
Reference in New Issue