From a1ec4d94543c5f347d600bb5234cc47fc9f15b07 Mon Sep 17 00:00:00 2001 From: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com> Date: Tue, 18 Apr 2023 13:41:06 +1200 Subject: [PATCH 1/2] feat: add toggle sidebar-minimap functionality --- packages/trpc-panel/src/react-app/Root.tsx | 2 +- .../src/react-app/components/Chevron.tsx | 4 ++- .../src/react-app/components/SideNav.tsx | 5 +-- .../src/react-app/components/TopBar.tsx | 32 ++++++++++++++++--- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/packages/trpc-panel/src/react-app/Root.tsx b/packages/trpc-panel/src/react-app/Root.tsx index 1c58eff..a2823f2 100644 --- a/packages/trpc-panel/src/react-app/Root.tsx +++ b/packages/trpc-panel/src/react-app/Root.tsx @@ -84,7 +84,7 @@ function AppInnards({ rootRouter }: { rootRouter: ParsedRouter }) { 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() + +