From bdf46437afdc59ca98d0b94d3017858e9badb3b0 Mon Sep 17 00:00:00 2001 From: Marcos Reifonas Date: Thu, 24 Sep 2026 19:21:21 +0000 Subject: [PATCH] feat: ajustar layout abaixo do banner do Hub e ocultar targa no Modo Smart --- src/components/AppRoutes.tsx | 3 +++ src/components/Layout.tsx | 4 +-- src/components/ui/sidebar.tsx | 13 +++++++-- src/hooks/useHubBanner.ts | 50 +++++++++++++++++++++++++++++++++++ src/index.css | 26 ++++++++++++++++++ src/pages/ModoSmart.tsx | 17 ++++++++++++ src/pages/Visualizador3D.tsx | 2 +- 7 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 src/hooks/useHubBanner.ts diff --git a/src/components/AppRoutes.tsx b/src/components/AppRoutes.tsx index 0014a8a..30edb46 100644 --- a/src/components/AppRoutes.tsx +++ b/src/components/AppRoutes.tsx @@ -5,6 +5,7 @@ import { ProtectedRoute } from './ProtectedRoute'; import { ProtectedAdminRoute } from './ProtectedAdminRoute'; import { ProtectedRouteByResource } from './ProtectedRouteByResource'; import { routeConfig, RouteDefinition } from '@/config/routeConfig'; +import { useHubBanner } from '@/hooks/useHubBanner'; // ============================================================================ // Fallback de loading para Suspense @@ -84,6 +85,8 @@ function wrapWithGuard( // ============================================================================ export function AppRoutes() { + useHubBanner(); + const routes = useMemo( () => routeConfig.map((route) => { diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 071fa99..0829529 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -26,9 +26,9 @@ export const Layout = ({ children }: LayoutProps) => { return ( -
+
-
+
{/* Header fixo com SidebarTrigger, Modo Smart e ThemeToggle */}
diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx index eb67997..ae44395 100644 --- a/src/components/ui/sidebar.tsx +++ b/src/components/ui/sidebar.tsx @@ -202,6 +202,8 @@ const Sidebar = React.forwardRef< style={ { "--sidebar-width": SIDEBAR_WIDTH_MOBILE, + top: "var(--hub-banner-height, 0px)", + height: "calc(100vh - var(--hub-banner-height, 0px))", } as React.CSSProperties } side={side} @@ -224,17 +226,20 @@ const Sidebar = React.forwardRef< {/* This is what handles the sidebar gap on desktop */}