diff --git a/packages/trpc-panel/src/react-app/Root.tsx b/packages/trpc-panel/src/react-app/Root.tsx index 1c58eff..946e8fe 100644 --- a/packages/trpc-panel/src/react-app/Root.tsx +++ b/packages/trpc-panel/src/react-app/Root.tsx @@ -8,6 +8,7 @@ import { HeadersContextProvider, useHeaders, } from "@src/react-app/components/contexts/HeadersContext"; +import { useLocalStorage } from "@src/react-app/components/hooks/useLocalStorage"; import { HeadersPopup } from "@src/react-app/components/HeadersPopup"; import { Toaster } from "react-hot-toast"; import { SiteNavigationContextProvider } from "@src/react-app/components/contexts/SiteNavigationContext"; @@ -80,11 +81,14 @@ function ClientProviders({ } function AppInnards({ rootRouter }: { rootRouter: ParsedRouter }) { - const [sidebarOpen, setSidebarOpen] = useState(true); + const [sidebarOpen, setSidebarOpen] = useLocalStorage( + "trpc-panel.show-minimap", + true + ); return (
- +
void; }) { - return ( + return open ? (
- ); + ) : null; } function SideNavItem({ diff --git a/packages/trpc-panel/src/react-app/components/TopBar.tsx b/packages/trpc-panel/src/react-app/components/TopBar.tsx index 1008359..97341e8 100644 --- a/packages/trpc-panel/src/react-app/components/TopBar.tsx +++ b/packages/trpc-panel/src/react-app/components/TopBar.tsx @@ -3,17 +3,39 @@ import { useHeadersContext } from "@src/react-app/components/contexts/HeadersCon import MailLockIcon from "@mui/icons-material/MailLockOutlined"; import { LogoSvg } from "@src/react-app/components/LogoSvg"; import { useIsMac } from "@src/react-app/components/hooks/useIsMac"; +import { Chevron } from "@src/react-app/components/Chevron"; import Search from "@mui/icons-material/Search"; import { useSearch } from "@src/react-app/components/contexts/SearchStore"; -export function TopBar() { +export function TopBar({ + open, + setOpen, +}: { + open: boolean; + setOpen: React.Dispatch>; +}) { const { setHeadersPopupShown } = useHeadersContext(); return (
- - - tRPC.panel() - +
+ + + + tRPC.panel() + +