diff --git a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx index fa812fc2c7..404024cbeb 100644 --- a/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx +++ b/frontend/apps/editor3d/app/src/components/signaled/TopBar/TopBar.tsx @@ -1,6 +1,5 @@ import { useContext, useEffect, useState } from "react"; import { - faChevronLeft, faGear, faImages, faCube, @@ -8,12 +7,9 @@ import { faPaintbrush, faImage, } from "@fortawesome/pro-solid-svg-icons"; -import { useLocation, useParams } from "react-router-dom"; import { Button } from "@storyteller/ui-button"; -// import { ButtonLink } from "@storyteller/ui-button-link"; import { AuthButtons } from "./AuthButtons"; import { SceneTitleInput } from "./SceneTitleInput"; -import { getCurrentLocationWithoutParams } from "~/utilities"; import { Activity } from "~/pages/PageEnigma/comps/GenerateModals/Activity"; import { GalleryModal, @@ -33,12 +29,6 @@ import { setLogoutStates } from "~/signals/authentication/utilities"; import { EngineContext } from "~/pages/PageEnigma/contexts/EngineContext"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -function isEditorPath(path: string) { - if (path === "/") return true; - if (path === "/idealenigma/") return true; - return false; -} - interface Props { pageName: string; appTabIdSignal: Signal; @@ -46,23 +36,30 @@ interface Props { is3DInitSignal: Signal; } +// This is the tab we start with. +export const STARTING_APP_TAB_ID = "2D"; + const appMenuTabs: MenuIconItem[] = [ { id: "2D", label: "2D Canvas", icon: , }, - { id: "3D", label: "3D Editor", icon: }, { - id: "VIDEO", - label: "Prompt to Video", - icon: , + id: "3D", + label: "3D Editor", + icon: }, { id: "IMAGE", label: "Prompt to Image", icon: , }, + { + id: "VIDEO", + label: "Prompt to Video", + icon: , + }, ]; export const topNavMediaId = signal(""); @@ -76,10 +73,6 @@ export const TopBar = ({ }: Props) => { useSignals(); - const currentLocation = getCurrentLocationWithoutParams( - useLocation().pathname, - useParams(), - ); const [isSettingsModalOpen, setIsSettingsModalOpen] = useState(false); const [url, setUrl] = useState(""); @@ -157,11 +150,6 @@ export const TopBar = ({ alt="Logo ArtCraft" /> - {/* {!isEditorPath(currentLocation) && ( - - Back to Editor - - )} */} { - if (newId != "2D" && newId != "3D" && newId != "VIDEO" && newId != "IMAGE") { - console.error("Provided app ID is not valid"); - return; + switch (newId) { + case "2D": + case "3D": + case "IMAGE": + case "VIDEO": + break; + default: + console.error("Provided app ID is not valid"); + return; } appTabId.value = newId; }; export const is3DEditorInitialized = signal(false); + export const setIs3DEditorInitialized = (isInitialized: boolean) => { is3DEditorInitialized.value = isInitialized; };