feat: Implement collaboration features including user following and avatar management

This commit is contained in:
2025-04-29 12:50:14 +05:30
parent ea53af62c4
commit c1a7fe3015
16 changed files with 243 additions and 63 deletions

View File

@@ -1,11 +1,10 @@
import React, { useEffect, useState } from "react";
import React, { useEffect } from "react";
import ModuleToggle from "../components/ui/ModuleToggle";
import SideBarLeft from "../components/layout/sidebarLeft/SideBarLeft";
import SideBarRight from "../components/layout/sidebarRight/SideBarRight";
import useModuleStore, { useThreeDStore } from "../store/useModuleStore";
import RealTimeVisulization from "../modules/visualization/RealTimeVisulization";
import Tools from "../components/ui/Tools";
// import Scene from "../modules/scene/scene";
import {
useSocketStore,
useFloorItems,
@@ -20,12 +19,9 @@ import { usePlayButtonStore } from "../store/usePlayButtonStore";
import MarketPlace from "../modules/market/MarketPlace";
import LoadingPage from "../components/templates/LoadingPage";
import SimulationPlayer from "../components/ui/simulation/simulationPlayer";
import RenderOverlay from "../components/templates/Overlay";
import MenuBar from "../components/ui/menu/menu";
import KeyPressListener from "../utils/shortcutkeys/handleShortcutKeys";
import ProductionCapacity from "../components/ui/analysis/ProductionCapacity";
import ThroughputSummary from "../components/ui/analysis/ThroughputSummary";
import ROISummary from "../components/ui/analysis/ROISummary";
import { useSelectedUserStore } from "../store/useCollabStore";
import FollowPerson from "../components/templates/FollowPerson";
const Project: React.FC = () => {
let navigate = useNavigate();
@@ -44,7 +40,7 @@ const Project: React.FC = () => {
setActiveModule("builder");
const email = localStorage.getItem("email");
if (email) {
const Organization = email!.split("@")[1].split(".")[0];
const Organization = email.split("@")[1].split(".")[0];
useSocketStore.getState().initializeSocket(email, Organization);
const name = localStorage.getItem("userName");
if (Organization && name) {
@@ -55,8 +51,10 @@ const Project: React.FC = () => {
navigate("/");
}
}, []);
const { isPlaying } = usePlayButtonStore();
const { toggleThreeD } = useThreeDStore();
const { selectedUser } = useSelectedUserStore();
return (
<div className="project-main">
@@ -81,6 +79,7 @@ const Project: React.FC = () => {
<RealTimeVisulization />
{activeModule !== "market" && <Tools />}
{isPlaying && activeModule === "simulation" && <SimulationPlayer />}
{selectedUser && <FollowPerson />}
</div>
);
};