code optimization
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { DepthOfField, Bloom, EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import { EffectComposer, N8AO } from "@react-three/postprocessing";
|
||||
import OutlineInstances from "./outlineInstances/outlineInstances";
|
||||
import { useDeletableEventSphere, useSelectedEventSphere } from "../../../store/simulation/useSimulationStore";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export default function PostProcessing() {
|
||||
const { } = useSelectedEventSphere();
|
||||
const { } = useDeletableEventSphere();
|
||||
const { selectedEventSphere } = useSelectedEventSphere();
|
||||
const { deletableEventSphere } = useDeletableEventSphere();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
}, [selectedEventSphere, deletableEventSphere])
|
||||
|
||||
return (
|
||||
<EffectComposer autoClear={false}>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
useSocketStore
|
||||
} from "../store/builder/store";
|
||||
import { useSocketStore } from "../store/builder/store";
|
||||
import DashboardHome from "../components/Dashboard/DashboardHome";
|
||||
import DashboardProjects from "../components/Dashboard/DashboardProjects";
|
||||
import DashboardTrash from "../components/Dashboard/DashboardTrash";
|
||||
@@ -10,29 +8,27 @@ import SidePannel from "../components/Dashboard/SidePannel";
|
||||
import DashboardTutorial from "../components/Dashboard/DashboardTutorial";
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
const [activeTab, setActiveTab] = useState<string>("Home");
|
||||
const { socket } = useSocketStore();
|
||||
const { organization, email } = getUserData();
|
||||
const [activeTab, setActiveTab] = useState<string>("Home");
|
||||
const { socket } = useSocketStore();
|
||||
const { organization, email } = getUserData();
|
||||
|
||||
useEffect(() => {
|
||||
const token = localStorage.getItem("token");
|
||||
const refreshToken = localStorage.getItem("refreshToken")
|
||||
if (token) {
|
||||
useSocketStore.getState().initializeSocket(email, organization, token, refreshToken);
|
||||
} else {
|
||||
useEffect(() => {
|
||||
const token = localStorage.getItem("token");
|
||||
const refreshToken = localStorage.getItem("refreshToken")
|
||||
if (token) {
|
||||
useSocketStore.getState().initializeSocket(email, organization, token, refreshToken);
|
||||
}
|
||||
}, [socket, email, organization]);
|
||||
|
||||
}
|
||||
}, [socket]);
|
||||
|
||||
return (
|
||||
<div className="dashboard-main">
|
||||
<SidePannel setActiveTab={setActiveTab} activeTab={activeTab} />
|
||||
{activeTab == "Home" && <DashboardHome />}
|
||||
{activeTab == "Projects" && <DashboardProjects />}
|
||||
{activeTab == "Trash" && <DashboardTrash />}
|
||||
{activeTab == "Tutorials" && <DashboardTutorial />}
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div className="dashboard-main">
|
||||
<SidePannel setActiveTab={setActiveTab} activeTab={activeTab} />
|
||||
{activeTab === "Home" && <DashboardHome />}
|
||||
{activeTab === "Projects" && <DashboardProjects />}
|
||||
{activeTab === "Trash" && <DashboardTrash />}
|
||||
{activeTab === "Tutorials" && <DashboardTutorial />}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Object3D } from "three";
|
||||
import { create } from "zustand";
|
||||
import { io } from "socket.io-client";
|
||||
import * as CONSTANTS from "../../types/world/worldConstants";
|
||||
|
||||
Reference in New Issue
Block a user