diff --git a/typescript-sdk/apps/dojo/src/components/layout/main-layout.tsx b/typescript-sdk/apps/dojo/src/components/layout/main-layout.tsx index 6ec0c62ca..258b146e6 100644 --- a/typescript-sdk/apps/dojo/src/components/layout/main-layout.tsx +++ b/typescript-sdk/apps/dojo/src/components/layout/main-layout.tsx @@ -1,29 +1,20 @@ "use client"; -import React, { useState } from "react"; +import React, { Suspense, useState } from "react"; import { ViewerLayout } from "@/components/layout/viewer-layout"; import { Sidebar } from "@/components/sidebar/sidebar"; -import { usePathname, useSearchParams } from "next/navigation"; -import featureConfig from "@/config"; +import { useSearchParams } from "next/navigation"; export function MainLayout({ children }: { children: React.ReactNode }) { - const pathname = usePathname(); - const searchParams = useSearchParams(); - - const sidebarDisabled = searchParams.get("sidebar") === "disabled"; - const integrationPickerDisabled = searchParams.get("picker") === "false"; - - // Extract the current demo ID from the pathname - const pathParts = pathname.split("/"); - const currentFeatureId = pathParts[pathParts.length - 1]; - const currentFeature = featureConfig.find((d) => d.id === currentFeatureId); - return (
{/* Sidebar */} - {!sidebarDisabled && } + + + + {/* Content */}
@@ -33,3 +24,12 @@ export function MainLayout({ children }: { children: React.ReactNode }) { ); } + +function MaybeSidebar() { + const searchParams = useSearchParams(); + + const sidebarDisabled = searchParams.get("sidebar") === "disabled"; + const integrationPickerDisabled = searchParams.get("picker") === "false"; + + return !sidebarDisabled && ; +} \ No newline at end of file