Skip to content

Commit 12b99c9

Browse files
fix: hide mobile header when sidebarHidden=true (sidebar=false)
1 parent 55c5ae4 commit 12b99c9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

typescript-sdk/apps/dojo/src/components/layout/main-layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useURLParams } from "@/contexts/url-params-context";
1010
import { getTitleForCurrentDomain } from "@/utils/domain-config";
1111

1212
export function MainLayout({ children }: { children: React.ReactNode }) {
13+
const { sidebarHidden } = useURLParams();
1314
const [isMobileSidebarOpen, setIsMobileSidebarOpen] = useState(false);
1415
const [isMobile, setIsMobile] = useState(false);
1516

@@ -42,7 +43,7 @@ export function MainLayout({ children }: { children: React.ReactNode }) {
4243
<ViewerLayout>
4344
<div className="flex h-full w-full overflow-hidden relative gap-2">
4445
{/* Mobile Header with Hamburger Menu */}
45-
{isMobile && (
46+
{isMobile && !sidebarHidden && (
4647
<div className="absolute top-0 left-0 right-0 z-50 bg-background border-b p-2 md:hidden">
4748
<div className="flex items-center justify-between">
4849
<Button
@@ -60,7 +61,7 @@ export function MainLayout({ children }: { children: React.ReactNode }) {
6061
)}
6162

6263
{/* Mobile Overlay */}
63-
{isMobile && isMobileSidebarOpen && (
64+
{isMobile && isMobileSidebarOpen && !sidebarHidden && (
6465
<div
6566
className="absolute inset-0 bg-black/50 z-40 md:hidden"
6667
onClick={toggleMobileSidebar}
@@ -76,7 +77,7 @@ export function MainLayout({ children }: { children: React.ReactNode }) {
7677
</Suspense>
7778

7879
{/* Content */}
79-
<div className={`flex-1 overflow-auto ${isMobile ? 'pt-12' : ''}`}>
80+
<div className={`flex-1 overflow-auto ${isMobile && !sidebarHidden ? 'pt-12' : ''}`}>
8081
<div className="h-full">{children}</div>
8182
</div>
8283
</div>

0 commit comments

Comments
 (0)