diff options
| author | Frank <[email protected]> | 2025-08-29 23:32:17 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-08-29 23:32:17 -0400 |
| commit | 37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e (patch) | |
| tree | 053db9abcb2178c71b22ebeadd07f920750ef5d2 /cloud/web/src/pages/components/layout.tsx | |
| parent | 0178eab29bda2f1b37a29543cd313ede48ad3977 (diff) | |
| download | opencode-37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e.tar.gz opencode-37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e.zip | |
wip: cloud
Diffstat (limited to 'cloud/web/src/pages/components/layout.tsx')
| -rw-r--r-- | cloud/web/src/pages/components/layout.tsx | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/cloud/web/src/pages/components/layout.tsx b/cloud/web/src/pages/components/layout.tsx deleted file mode 100644 index 711ed8fc2..000000000 --- a/cloud/web/src/pages/components/layout.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import style from "./layout.module.css" -import { useAccount } from "../../components/context-account" -import { Button } from "../../ui/button" -import { IconLogomark } from "../../ui/svg" -import { IconBars3BottomLeft } from "../../ui/svg/icons" -import { ParentProps, createMemo, createSignal } from "solid-js" -import { A, useLocation } from "@solidjs/router" -import { useOpenAuth } from "../../components/context-openauth" - -export default function Layout(props: ParentProps) { - const auth = useOpenAuth() - const account = useAccount() - const [sidebarOpen, setSidebarOpen] = createSignal(false) - const location = useLocation() - - const workspaceId = createMemo(() => account.current?.workspaces[0].id) - const pageTitle = createMemo(() => { - const path = location.pathname - if (path.endsWith("/billing")) return "Billing" - if (path.endsWith("/keys")) return "API Keys" - return null - }) - - function handleLogout() { - auth.logout(auth.subject?.id!) - } - - return ( - <div class={style.root}> - {/* Mobile top bar */} - <div data-component="mobile-top-bar"> - <button data-slot="toggle" onClick={() => setSidebarOpen(!sidebarOpen())}> - <IconBars3BottomLeft /> - </button> - - <div data-slot="logo"> - {pageTitle() ? ( - <div>{pageTitle()}</div> - ) : ( - <A href="/"> - <IconLogomark /> - </A> - )} - </div> - </div> - - {/* Backdrop for mobile sidebar - closes sidebar when clicked */} - {sidebarOpen() && <div data-component="backdrop" onClick={() => setSidebarOpen(false)}></div>} - - <div data-component="sidebar" data-opened={sidebarOpen() ? "true" : "false"}> - <div data-slot="logo"> - <A href="/"> - <IconLogomark /> - </A> - </div> - - <nav data-slot="nav"> - <ul> - <li> - <A end activeClass={style.navActiveLink} href={`/${workspaceId()}`} onClick={() => setSidebarOpen(false)}> - Chat - </A> - </li> - <li> - <A - activeClass={style.navActiveLink} - href={`/${workspaceId()}/billing`} - onClick={() => setSidebarOpen(false)} - > - Billing - </A> - </li> - <li> - <A - activeClass={style.navActiveLink} - href={`/${workspaceId()}/keys`} - onClick={() => setSidebarOpen(false)} - > - API Keys - </A> - </li> - </ul> - </nav> - - <div data-slot="user"> - <Button color="ghost" onClick={handleLogout} title={account.current?.email || ""}> - Logout - </Button> - </div> - </div> - - {/* Main Content */} - <div data-slot="main-content">{props.children}</div> - </div> - ) -} |
