From 7667551f0798fe2e703944566af792d604f7168e Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Thu, 2 Jul 2026 15:56:04 +0000 Subject: [PATCH] feat(portal): collapsible sidebar in app frame When an app is open, the sidebar collapses to a 44px strip with a chevron button. Clicking it opens the full sidebar as a fixed overlay with a backdrop that closes on click. Also closes automatically when the user interacts with / navigates within the iframe (window blur). Co-Authored-By: Claude Sonnet 4.6 --- src/components/Sidebar.tsx | 32 ++++++++++++++++------- src/pages/AppFrame.tsx | 52 +++++++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 13 deletions(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 690547b..751c100 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -1,12 +1,12 @@ import { useState } from 'react' import { NavLink, useNavigate, useLocation } from 'react-router-dom' -import { LayoutGrid, Users, Activity, Settings, LogOut, ChevronDown, ShieldCheck, Building2 } from 'lucide-react' +import { LayoutGrid, Users, Activity, Settings, LogOut, ChevronDown, ChevronLeft, ShieldCheck, Building2 } from 'lucide-react' import { AppIcon } from './AppIcon' import type { User, App } from '../types' -interface Props { user: User; activeSlug?: string } +interface Props { user: User; activeSlug?: string; onCollapse?: () => void } -export function Sidebar({ user, activeSlug }: Props) { +export function Sidebar({ user, activeSlug, onCollapse }: Props) { const navigate = useNavigate() const location = useLocation() @@ -52,13 +52,27 @@ export function Sidebar({ user, activeSlug }: Props) { display: 'flex', flexDirection: 'column', height: '100dvh', position: 'sticky', top: 0, }}> -
-
- MANAGE -
-
- {import.meta.env.VITE_HOTEL_NAME} +
+
+
+ MANAGE +
+
+ {import.meta.env.VITE_HOTEL_NAME} +
+ {onCollapse && ( + + )}