From f301c96f1956c63e8eeb3ef6e5ae580235213dfe Mon Sep 17 00:00:00 2001 From: Vishnu Date: Wed, 10 Sep 2025 13:38:47 +0530 Subject: [PATCH 1/5] fix: style update fixes for light theme --- app/src/components/Dashboard/SidePannel.tsx | 13 +- app/src/components/icons/DashboardIcon.tsx | 529 +++--- app/src/components/icons/SimulationIcons.tsx | 1579 ++++++++--------- .../styles/layout/_resourceManagement.scss | 1 + 4 files changed, 1058 insertions(+), 1064 deletions(-) diff --git a/app/src/components/Dashboard/SidePannel.tsx b/app/src/components/Dashboard/SidePannel.tsx index b612ba6..413a289 100644 --- a/app/src/components/Dashboard/SidePannel.tsx +++ b/app/src/components/Dashboard/SidePannel.tsx @@ -6,12 +6,13 @@ import { LogoutIcon, NotificationIcon, ProjectsIcon, + TrashIcon, TutorialsIcon, } from "../icons/DashboardIcon"; import { useNavigate } from "react-router-dom"; import darkThemeImage from "../../assets/image/darkThemeProject.png"; import lightThemeImage from "../../assets/image/lightThemeProject.png"; -import { SettingsIcon, TrashIcon } from "../icons/ExportCommonIcons"; +import { SettingsIcon } from "../icons/ExportCommonIcons"; import { getUserData } from "../../functions/getUserData"; import { useLoadingProgress, useSocketStore } from "../../store/builder/store"; @@ -103,7 +104,7 @@ const SidePannel: React.FC = ({ setActiveTab, activeTab }) => { } onClick={() => setActiveTab("Home")} > - + Home diff --git a/app/src/components/icons/DashboardIcon.tsx b/app/src/components/icons/DashboardIcon.tsx index dbcfb7b..ac2f166 100644 --- a/app/src/components/icons/DashboardIcon.tsx +++ b/app/src/components/icons/DashboardIcon.tsx @@ -1,272 +1,297 @@ export function NotificationIcon() { - return ( - - - - - ); + return ( + + + + + ); } -export function HomeIcon() { - return ( - - - - ); +export function HomeIcon({ isActive }: Readonly<{ isActive: boolean }>) { + return ( + + + + ); } -export function ProjectsIcon() { - return ( - - - - ); +export function ProjectsIcon({ isActive }: Readonly<{ isActive: boolean }>) { + return ( + + + + ); } -export function TutorialsIcon() { - return ( - - - - - - - - - - - - - - - - - - - - ); +export function TrashIcon({ isActive }: Readonly<{ isActive: boolean }>) { + return ( + + + + + + + + + + + ); } -export function DocumentationIcon() { - return ( - - - - - ); +export function TutorialsIcon({ isActive }: Readonly<{ isActive: boolean }>) { + return ( + + + + + + + + + + + + + + + + + + + + ); +} + +export function DocumentationIcon({ isActive }: Readonly<{ isActive: boolean }>) { + return ( + + + + + ); } export function HelpIcon() { - return ( - - - - - - - - - - - ); + height="13" + viewBox="0 0 12 13" + fill="none" + xmlns="http://www.w3.org/2000/svg" + > + + + + + + + + + + ); } export function LogoutIcon() { - return ( - - - - - - ); + return ( + + + + + + ); } export function WifiIcon() { - return ( - - - - ); + return ( + + + + ); } diff --git a/app/src/components/icons/SimulationIcons.tsx b/app/src/components/icons/SimulationIcons.tsx index 95844ad..477b5f3 100644 --- a/app/src/components/icons/SimulationIcons.tsx +++ b/app/src/components/icons/SimulationIcons.tsx @@ -1,863 +1,830 @@ export function AnalysisIcon({ isActive }: Readonly<{ isActive: boolean }>) { - return ( - - - - - ); + return ( + + + + + ); } export function MechanicsIcon({ isActive }: Readonly<{ isActive: boolean }>) { - return ( - - - - - ); + return ( + + + + + ); } export function PropertiesIcon({ isActive }: Readonly<{ isActive: boolean }>) { - return ( - - - - - - ); + return ( + + + + + + ); } export function SimulationIcon({ isActive }: Readonly<{ isActive: boolean }>) { - return ( - - - - - ); + return ( + + + + + ); } // simulation player icons export function ResetIcon() { - return ( - - - - - - ); + return ( + + + + + + ); } export function PlayStopIcon() { - return ( - - - - ); + return ( + + + + ); } export function ExitIcon() { - return ( - - - - ); + return ( + + + + ); } export function MoveArrowRight() { - return ( - - - - ); + return ( + + + + ); } export function MoveArrowLeft() { - return ( - - - - ); + return ( + + + + ); } // simulation card icons -export function ExpandIcon({ - color = "#6F42C1", -}: Readonly<{ color?: string }>) { - return ( - - - - - ); +export function ExpandIcon({ color = "#6F42C1" }: Readonly<{ color?: string }>) { + return ( + + + + + ); } -export function SimulationStatusIcon({ - color = "#21FF59", -}: Readonly<{ color?: string }>) { - return ( - - - - - ); +export function SimulationStatusIcon({ color = "#21FF59" }: Readonly<{ color?: string }>) { + return ( + + + + + ); } export function IndicationArrow() { - return ( - - - - ); + return ( + + + + ); } export function CartBagIcon() { - return ( - - - - - - - - ); + return ( + + + + + + + + ); } export function StorageCapacityIcon() { - return ( - - - - - - - - - - - - - - - - - - - ); + viewBox="0 0 21 20" + fill="none" + xmlns="http://www.w3.org/2000/svg" + > + + + + + + + + + + + + + + + + + + ); } export function CompareLayoutIcon() { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); } export const ResizerIcon = () => { - return ( - - - - - - - - - - - - - - - - - - - ); + + + + + + + + + + + + + + + + + + ); }; export const LayoutIcon = () => { - return ( - - - - - - ); + return ( + + + + + + ); }; - export function FilePackageIcon({ isActive }: Readonly<{ isActive: boolean }>) { - - return ( - - - - - - - - - - - - - - - - - - - - ) -} \ No newline at end of file + return ( + + + + + + + + + + + + + + + + + + + ); +} diff --git a/app/src/styles/layout/_resourceManagement.scss b/app/src/styles/layout/_resourceManagement.scss index 48d768c..90bfe10 100644 --- a/app/src/styles/layout/_resourceManagement.scss +++ b/app/src/styles/layout/_resourceManagement.scss @@ -14,6 +14,7 @@ cursor: pointer; &.active { + color: var(--text-button-color); background: var(--background-color-button); } } From 9b2196621087e2a2f100525c1dfd4eaa29ae56f9 Mon Sep 17 00:00:00 2001 From: Vishnu Date: Wed, 10 Sep 2025 14:14:14 +0530 Subject: [PATCH 2/5] fix: dashboard types updated, tutorial started --- .../components/Dashboard/DashboardMain.tsx | 57 +++++++++++-------- .../Dashboard/DashboardTutorial.tsx | 51 +---------------- app/src/components/Dashboard/SidePannel.tsx | 8 +-- .../Dashboard/socket/projectSocketRes.tsx | 18 ++---- app/src/pages/Dashboard.tsx | 42 +++++++------- app/src/pages/ForgotPassword.tsx | 6 +- app/src/pages/sessionValidity.tsx | 15 ----- app/src/types/dashboard.d.ts | 16 ++++++ 8 files changed, 79 insertions(+), 134 deletions(-) delete mode 100644 app/src/pages/sessionValidity.tsx create mode 100644 app/src/types/dashboard.d.ts diff --git a/app/src/components/Dashboard/DashboardMain.tsx b/app/src/components/Dashboard/DashboardMain.tsx index a922263..3f25c09 100644 --- a/app/src/components/Dashboard/DashboardMain.tsx +++ b/app/src/components/Dashboard/DashboardMain.tsx @@ -14,36 +14,21 @@ import { restoreTrashApi } from "../../services/dashboard/restoreTrashApi"; import { generateUniqueId } from "../../functions/generateUniqueId"; import ProjectSocketRes from "./socket/projectSocketRes"; -interface Project { - _id: string; - projectName: string; - thumbnail: string; - createdBy: { _id: string; userName: string }; - projectUuid?: string; - createdAt?: string; - DeletedAt?: string; -} - -interface ProjectCollection { - [key: string]: Project[]; -} - -type Folder = "home" | "projects" | "shared" | "trash"; - interface DashboardMainProps { activeFolder: Folder; } const DashboardMain: React.FC = ({ activeFolder }) => { const [activeSubFolder, setActiveSubFolder] = useState("myProjects"); - const [projectsData, setProjectsData] = useState({}); + const [projectsData, setProjectsData] = useState({}); const [isSearchActive, setIsSearchActive] = useState(false); const [duplicateData, setDuplicateData] = useState({}); const [openKebabProjectId, setOpenKebabProjectId] = useState(null); - const [projectsCache, setProjectsCache] = useState<{ [key: string]: ProjectCollection }>({}); + const [projectsCache, setProjectsCache] = useState<{ [key: string]: DashboardProjectCollection }>({}); const { userId, organization } = getUserData(); const { projectSocket } = useSocketStore(); + console.log("duplicateData: ", duplicateData); // #region API Fetchers const fetchData = async () => { @@ -55,7 +40,7 @@ const DashboardMain: React.FC = ({ activeFolder }) => { } try { - let projects: ProjectCollection = {}; // initialize as empty object + let projects: DashboardProjectCollection = {}; // initialize as empty object switch (activeFolder) { case "home": @@ -71,6 +56,8 @@ const DashboardMain: React.FC = ({ activeFolder }) => { case "trash": projects = await getTrashApi(); break; + default: + return; } // Only update cache if projects is not empty @@ -129,7 +116,11 @@ const DashboardMain: React.FC = ({ activeFolder }) => { updateStateAfterRemove(projectId); }; - const handleDuplicate = async (projectId: string, projectName: string, thumbnail: string): Promise => { + const handleDuplicate = async ( + projectId: string, + projectName: string, + thumbnail: string + ): Promise => { if (projectSocket) { projectSocket.emit("v1:project:Duplicate", { userId, @@ -144,7 +135,7 @@ const DashboardMain: React.FC = ({ activeFolder }) => { // #region Project Map const updateStateAfterRemove = (projectId: string) => { - setProjectsData((prev: ProjectCollection) => { + setProjectsData((prev: DashboardProjectCollection) => { const key = Object.keys(prev)[0]; const updatedList = prev[key]?.filter((p) => p._id !== projectId) || []; return { ...prev, [key]: updatedList }; @@ -204,7 +195,12 @@ const DashboardMain: React.FC = ({ activeFolder }) => {
{activeFolder === "home" && } @@ -212,10 +208,16 @@ const DashboardMain: React.FC = ({ activeFolder }) => {
{activeFolder === "projects" && (
- -
@@ -223,7 +225,12 @@ const DashboardMain: React.FC = ({ activeFolder }) => {
{renderProjects()}
- +
); diff --git a/app/src/components/Dashboard/DashboardTutorial.tsx b/app/src/components/Dashboard/DashboardTutorial.tsx index f8c1d25..88625fd 100644 --- a/app/src/components/Dashboard/DashboardTutorial.tsx +++ b/app/src/components/Dashboard/DashboardTutorial.tsx @@ -1,61 +1,12 @@ -import { useEffect, useState } from "react"; import DashboardNavBar from "./DashboardNavBar"; -import DashboardCard from "./DashboardCard"; import { projectTutorialApi } from "../../services/dashboard/projectTutorialApi"; -interface Project { - _id: string; - projectName: string; - thumbnail: string; - createdBy: string; - projectUuid?: string; -} - -interface DiscardedProjects { - [key: string]: Project[]; -} - const DashboardTutorial = () => { - const [tutorialProject, setTutorialProject] = useState({}); - - const handleIcon = async () => { - try { - let tutorial = await projectTutorialApi(); - setTutorialProject(tutorial); - } catch {} - }; - - const [openKebabProjectId, setOpenKebabProjectId] = useState(null); - - useEffect(() => { - handleIcon(); - }, []); - - const renderTrashProjects = () => { - const projectList = tutorialProject[Object.keys(tutorialProject)[0]]; - - if (!projectList?.length) { - return
No deleted projects found
; - } - - return projectList.map((tutorials: any) => ( - - )); - }; return (
-
-
-
{renderTrashProjects()}
+
); diff --git a/app/src/components/Dashboard/SidePannel.tsx b/app/src/components/Dashboard/SidePannel.tsx index 40de6d6..10a1c08 100644 --- a/app/src/components/Dashboard/SidePannel.tsx +++ b/app/src/components/Dashboard/SidePannel.tsx @@ -115,9 +115,9 @@ const SidePannel: React.FC = ({ setActiveTab, activeTab }) => {