diff --git a/next_app/src/components/bottom-tab-bar.tsx b/next_app/src/components/bottom-tab-bar.tsx index 87555f0..36ad6c4 100644 --- a/next_app/src/components/bottom-tab-bar.tsx +++ b/next_app/src/components/bottom-tab-bar.tsx @@ -68,7 +68,7 @@ export default function BottomTabBar({ collapsed, toggle, setFullScreen, fullscr console.log(data); fetchFlag = true; // toast({ variant: "newMessage", title: stripAnsiCodes(data) }); - toast.custom((id) =>
{stripAnsiCodes(data)}
); + toast.custom((id) =>
{stripAnsiCodes(data)}
); setCommandOutputs(p => [...p, data]); } diff --git a/next_app/src/components/side-bar.tsx b/next_app/src/components/side-bar.tsx index 85633e7..0f8536a 100644 --- a/next_app/src/components/side-bar.tsx +++ b/next_app/src/components/side-bar.tsx @@ -14,154 +14,156 @@ import { toast } from "sonner"; import { Dialog, DialogContent, DialogTrigger } from "./ui/dialog"; export default function SideBar({ collapsed, setCollapsed, manager }: { collapsed: boolean; setCollapsed: Dispatch>; manager: ProjectManager }) { - const globalState = useGlobalState(); - const [mounted, setMounted] = useState(false); - const [activeAddress, setActiveAddress] = useState(""); + const globalState = useGlobalState(); + const [mounted, setMounted] = useState(false); + const [activeAddress, setActiveAddress] = useState(""); - const projects = Object.keys(manager.projects).filter((p) => manager.projects[p].mode == globalState.activeMode); + const projects = Object.keys(manager.projects).filter((p) => manager.projects[p].mode == globalState.activeMode); - useEffect(() => { - if (typeof window == "undefined") return; - setMounted(true); - async function a() { - if (!window.arweaveWallet) return; - setActiveAddress(await window.arweaveWallet.getActiveAddress()); - } - a(); - }, [globalState.activeProject]); + useEffect(() => { + if (typeof window == "undefined") return; + setMounted(true); + async function a() { + if (!window.arweaveWallet) return; + setActiveAddress(await window.arweaveWallet.getActiveAddress()); + } + a(); + }, [globalState.activeProject]); - return ( -
setCollapsed(false)} onMouseLeave={() => setCollapsed(true)}> - {globalState.activeMode == "AO" ? : } -
- {mounted && - projects.map((pname, _) => { - const active = pname === globalState.activeProject; - const ownedByActiveWallet = manager.projects[pname].ownerWallet == activeAddress; - let ownerAddress = manager.projects[pname].ownerWallet; - return ( -
-
- { - let shortAddress = "unknown"; - if (typeof ownerAddress == "string") shortAddress = ownerAddress.slice(0, 5) + "..." + ownerAddress.slice(-5); - // if (!ownedByActiveWallet) toast({ title: "The owner wallet for this project cant be verified", description: `It was created with ${shortAddress}.\nSome things might be broken` }) - if (!ownedByActiveWallet) toast.error("The owner wallet for this project cant be verified", { description: `It was created with ${shortAddress}.\nSome things might be broken`, id: "error" }); - globalState.setActiveProject(active ? "" : pname); - }} - /> + return ( +
setCollapsed(false)} onMouseLeave={() => setCollapsed(true)}> + {globalState.activeMode == "AO" ? : } +
+
+ {mounted && + projects.map((pname, _) => { + const active = pname === globalState.activeProject; + const ownedByActiveWallet = manager.projects[pname].ownerWallet == activeAddress; + let ownerAddress = manager.projects[pname].ownerWallet; + return ( +
+
+ { + let shortAddress = "unknown"; + if (typeof ownerAddress == "string") shortAddress = ownerAddress.slice(0, 5) + "..." + ownerAddress.slice(-5); + // if (!ownedByActiveWallet) toast({ title: "The owner wallet for this project cant be verified", description: `It was created with ${shortAddress}.\nSome things might be broken` }) + if (!ownedByActiveWallet) toast.error("The owner wallet for this project cant be verified", { description: `It was created with ${shortAddress}.\nSome things might be broken`, id: "error" }); + globalState.setActiveProject(active ? "" : pname); + }} + /> - {!collapsed && ( -
-
{ - let shortAddress = "unknown"; - if (typeof ownerAddress == "string") shortAddress = ownerAddress.slice(0, 5) + "..." + ownerAddress.slice(-5); - // if (!ownedByActiveWallet) toast({ title: "The owner wallet for this project cant be verified", description: `It was created with ${shortAddress}.\nSome things might be broken` }) - if (!ownedByActiveWallet) toast.error("The owner wallet for this project cant be verified", { description: `It was created with ${shortAddress}.\nSome things might be broken`, id: "error" }); - globalState.setActiveProject(active ? "" : pname); - if (active) return; - const file = Object.keys(manager.projects[pname].files)[0]; - console.log(file); - if (file) globalState.setActiveFile(file); - }} - > - + {!collapsed && ( +
+
{ + let shortAddress = "unknown"; + if (typeof ownerAddress == "string") shortAddress = ownerAddress.slice(0, 5) + "..." + ownerAddress.slice(-5); + // if (!ownedByActiveWallet) toast({ title: "The owner wallet for this project cant be verified", description: `It was created with ${shortAddress}.\nSome things might be broken` }) + if (!ownedByActiveWallet) toast.error("The owner wallet for this project cant be verified", { description: `It was created with ${shortAddress}.\nSome things might be broken`, id: "error" }); + globalState.setActiveProject(active ? "" : pname); + if (active) return; + const file = Object.keys(manager.projects[pname].files)[0]; + console.log(file); + if (file) globalState.setActiveFile(file); + }} + > + - {pname} -
-
- )} -
- {active && !collapsed && ( -
-
- - setCollapsed(!open)}> - : - -
- - - -
-
-
-
+ {pname} +
+
+ )} +
+ {active && !collapsed && ( +
+
+ + setCollapsed(!open)}> + : + +
+ + + +
+
+
+
- {Object.keys(manager.projects[pname].files).map((fname, _) => { - return ( -
-
- - - -
- - - {/* setCollapsed(!e)}> + {Object.keys(manager.projects[pname].files).map((fname, _) => { + return ( +
+
+ + + +
+ + + {/* setCollapsed(!e)}>
+ +
+
+ ); + })} +
+ )}
- -
-
- ); - })} -
- )} + ); + })}
- ); - })} -
+
- - - ); + {!collapsed && Settings} + + + ); }