v2-ui #94
|
@ -1,7 +1,11 @@
|
|||
import React, { useState } from "react";
|
||||
import { getAvatarColor } from "../../../modules/collaboration/functions/getAvatarColor";
|
||||
|
||||
const CommentThreads: React.FC = () => {
|
||||
interface CommentThreadsProps {
|
||||
commentClicked: () => void;
|
||||
}
|
||||
|
||||
const CommentThreads: React.FC<CommentThreadsProps> = ({ commentClicked }) => {
|
||||
const [expand, setExpand] = useState(false);
|
||||
const commentsedUsers = [{ creatorId: "1" }];
|
||||
|
||||
|
@ -12,11 +16,25 @@ const CommentThreads: React.FC = () => {
|
|||
createdAt: "2 hours ago",
|
||||
comment: "Thread check",
|
||||
lastUpdatedAt: "string",
|
||||
replies: [],
|
||||
replies: [
|
||||
{
|
||||
replyId: 'string',
|
||||
creatorId: 'string',
|
||||
createdAt: 'string',
|
||||
lastUpdatedAt: 'string',
|
||||
reply: 'string',
|
||||
},
|
||||
{
|
||||
replyId: 'string',
|
||||
creatorId: 'string',
|
||||
createdAt: 'string',
|
||||
lastUpdatedAt: 'string',
|
||||
reply: 'string',
|
||||
}
|
||||
],
|
||||
};
|
||||
|
||||
function getUsername(userId: string) {
|
||||
console.log(userId);
|
||||
const UserName = "username";
|
||||
return UserName;
|
||||
}
|
||||
|
@ -24,6 +42,7 @@ const CommentThreads: React.FC = () => {
|
|||
function getDetails(type?: "clicked") {
|
||||
if (type === "clicked") {
|
||||
setExpand(true);
|
||||
commentClicked();
|
||||
} else {
|
||||
setExpand((prev) => !prev);
|
||||
}
|
||||
|
@ -35,8 +54,7 @@ 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`}
|
||||
>
|
||||
<div className="users-commented">
|
||||
|
@ -61,7 +79,7 @@ const CommentThreads: React.FC = () => {
|
|||
</div>
|
||||
<div className="message">{CommentDetails.comment}</div>
|
||||
{CommentDetails.replies.length > 0 && (
|
||||
<div className="replies">{CommentDetails.replies.length}</div>
|
||||
<div className="replies">{CommentDetails.replies.length} reply(s)</div>
|
||||
)}
|
||||
</div>
|
||||
</button>
|
||||
|
|
|
@ -10,7 +10,7 @@ function updateDistanceText(
|
|||
|
||||
////////// Updating the Distance Texts of the lines that are affected during drag //////////
|
||||
|
||||
const DistanceGroup = scene.children.find((child) => child.name === "Distance_Text") as THREE.Group;
|
||||
const DistanceGroup = scene.getObjectByName('Distance_Text') as THREE.Group;
|
||||
|
||||
affectedLines.forEach((lineIndex) => {
|
||||
const mesh = floorPlanGroupLine.current.children[lineIndex] as THREE.Mesh;
|
||||
|
|
|
@ -10,7 +10,6 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
|||
const [selectedComment, setSelectedComment] = useState<CommentSchema | null>(null);
|
||||
const [transformMode, setTransformMode] = useState<"translate" | "rotate" | null>(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
const keyCombination = detectModifierKeys(e);
|
||||
|
@ -27,6 +26,11 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
|||
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||
}, [selectedComment]);
|
||||
|
||||
const commentClicked = () => {
|
||||
console.log('hii');
|
||||
setSelectedComment(comment);
|
||||
}
|
||||
|
||||
if (comment.state === 'inactive' || isPlaying) return null;
|
||||
|
||||
return (
|
||||
|
@ -42,21 +46,7 @@ function CommentInstance({ comment }: { comment: CommentSchema }) {
|
|||
rotation={comment.rotation}
|
||||
className='comments-main-wrapper'
|
||||
>
|
||||
<CommentThreads />
|
||||
{/* <div
|
||||
className='outer'
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
setSelectedComment(comment);
|
||||
console.log("down");
|
||||
}}
|
||||
onPointerOver={(e) => {
|
||||
e.stopPropagation();
|
||||
}}>
|
||||
<div>
|
||||
hii
|
||||
</div>
|
||||
</div> */}
|
||||
<CommentThreads commentClicked={commentClicked} />
|
||||
</Html>
|
||||
{CommentRef.current && transformMode && (
|
||||
<TransformControls
|
||||
|
|
|
@ -6,7 +6,7 @@ function CommentInstances() {
|
|||
const { comments } = useCommentStore();
|
||||
|
||||
useEffect(() => {
|
||||
console.log('comments: ', comments);
|
||||
// console.log('comments: ', comments);
|
||||
}, [comments])
|
||||
|
||||
return (
|
||||
|
|
|
@ -218,7 +218,7 @@ const MeasurementTool = () => {
|
|||
sprite
|
||||
>
|
||||
<div>
|
||||
{startConePosition.distanceTo(endConePosition).toFixed(2)} m
|
||||
{(startConePosition.distanceTo(endConePosition) + (coneSize.height)).toFixed(2)} m
|
||||
</div>
|
||||
</Html>
|
||||
)}
|
||||
|
|
Loading…
Reference in New Issue