diff --git a/frontend/src/components/sidebar/Sidebar.tsx b/frontend/src/components/sidebar/Sidebar.tsx index d75149b72..38ac1aa71 100644 --- a/frontend/src/components/sidebar/Sidebar.tsx +++ b/frontend/src/components/sidebar/Sidebar.tsx @@ -5,31 +5,46 @@ import { combineClasses, inPx } from "../../util/helpers"; import AddServer from "../create/Server"; import { TOPBAR_HEIGHT } from "../topbar/Topbar"; import Grid from "../util/layout/Grid"; +import Tabs from "../util/tabs/Tabs"; import Builds from "./builds/Builds"; import Server from "./server/Server"; import s from "./sidebar.module.css"; const SIDEBAR_WIDTH = 350; -const Sidebar: Component<{}> = (p) => { +const Sidebar: Component<{}> = () => { const { sidebar, servers } = useAppState(); const { height } = useAppDimensions(); return ( - - - {(id) => } - -
- - - + tabsGap="0rem" + tabs={[ + { + title: "deployments", + element: ( + + {(id) => } + + + ), + }, + { + title: "builds", + element: ( + + + + ), + }, + ]} + localStorageKey="sidebar-tab" + /> ); }; diff --git a/frontend/src/components/sidebar/builds/Builds.tsx b/frontend/src/components/sidebar/builds/Builds.tsx index 809e2e4ed..c4ff6a4e1 100644 --- a/frontend/src/components/sidebar/builds/Builds.tsx +++ b/frontend/src/components/sidebar/builds/Builds.tsx @@ -34,6 +34,15 @@ const Builds: Component<{}> = (p) => {
); + // return ( + // + // {(id) => } + // + // + // ); }; export default Builds; diff --git a/frontend/src/components/util/tabs/Tabs.module.css b/frontend/src/components/util/tabs/Tabs.module.css index b4bd4c4ba..52346b22c 100644 --- a/frontend/src/components/util/tabs/Tabs.module.css +++ b/frontend/src/components/util/tabs/Tabs.module.css @@ -4,13 +4,6 @@ gap: 1rem; } -.TabTitles { - display: flex; - align-items: center; - justify-content: space-evenly; - gap: 1rem; -} - .Tab { display: grid; place-items: center; @@ -19,7 +12,6 @@ cursor: pointer; font-size: 1rem; width: 100%; - background-color: rgba(2, 107, 121, 0); border-bottom: solid 2px rgba(2, 107, 121, 0.5); transition: background-color 250ms ease-in-out, border-color 250ms ease-in-out; diff --git a/frontend/src/components/util/tabs/Tabs.tsx b/frontend/src/components/util/tabs/Tabs.tsx index ec6089210..46fabd569 100644 --- a/frontend/src/components/util/tabs/Tabs.tsx +++ b/frontend/src/components/util/tabs/Tabs.tsx @@ -1,6 +1,7 @@ import { Component, createSignal, For, JSX, JSXElement } from "solid-js"; import { combineClasses } from "../../../util/helpers"; import { useLocalStorage } from "../../../util/hooks"; +import Flex from "../layout/Flex"; import s from "./Tabs.module.css"; export type Tab = { @@ -13,8 +14,8 @@ const Tabs: Component<{ tabs: Tab[]; defaultSelected?: string; localStorageKey?: string; + tabsGap?: string; tabStyle?: JSX.CSSProperties; - titleElement?: JSXElement; titleStyle?: JSX.CSSProperties; containerClass?: string; containerStyle?: JSX.CSSProperties; @@ -29,7 +30,7 @@ const Tabs: Component<{ selected() === title ? combineClasses(s.Tab, s.Active) : s.Tab; return (
-
+ {(tab) => (
+ {current().element}
);