File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
typescript-sdk/apps/dojo/src/components/layout Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,14 @@ import React, { useState } from "react";
44import { ViewerLayout } from "@/components/layout/viewer-layout" ;
55import { Sidebar } from "@/components/sidebar/sidebar" ;
66
7- import { usePathname } from "next/navigation" ;
7+ import { usePathname , useSearchParams } from "next/navigation" ;
88import featureConfig from "@/config" ;
99
1010export 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" >
You can’t perform that action at this time.
0 commit comments