Skip to content

Commit d144b88

Browse files
committed
chore: add disabling of dojo sidebar
1 parent 22d539c commit d144b88

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import React, { useState } from "react";
44
import { ViewerLayout } from "@/components/layout/viewer-layout";
55
import { Sidebar } from "@/components/sidebar/sidebar";
66

7-
import { usePathname } from "next/navigation";
7+
import { usePathname, useSearchParams } from "next/navigation";
88
import featureConfig from "@/config";
99

1010
export function MainLayout({ children }: { children: React.ReactNode }) {
1111
const pathname = usePathname();
12+
const searchParams = useSearchParams();
13+
14+
const sidebarDisabled = searchParams.get("sidebar") === "disabled";
1215

1316
// Extract the current demo ID from the pathname
1417
const pathParts = pathname.split("/");
@@ -19,7 +22,7 @@ export function MainLayout({ children }: { children: React.ReactNode }) {
1922
<ViewerLayout showFileTree={false} showCodeEditor={false}>
2023
<div className="flex h-full w-full overflow-hidden">
2124
{/* Sidebar */}
22-
<Sidebar activeTab={"preview"} readmeContent={""} />
25+
{!sidebarDisabled && <Sidebar activeTab={"preview"} readmeContent={""} />}
2326

2427
{/* Content */}
2528
<div className="flex-1 overflow-auto">

0 commit comments

Comments
 (0)