From 6689604e48d75f4ecce23c896034400e7b6754f7 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 1 Aug 2022 23:07:05 +0800 Subject: [PATCH] ui: scratchpad: hide sidebar if no extra page loaded --- packages/ui-default/components/scratchpad/index.jsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/ui-default/components/scratchpad/index.jsx b/packages/ui-default/components/scratchpad/index.jsx index 6bfbba48f..918e030b7 100644 --- a/packages/ui-default/components/scratchpad/index.jsx +++ b/packages/ui-default/components/scratchpad/index.jsx @@ -34,10 +34,7 @@ function buildNestedPane([a, ...panes], mode = 'horizontal') { const pages = { problem: { icon: () => , - component: () => { - console.log($('.problem-content')); - return ; - }, + component: () => , }, }; @@ -78,14 +75,16 @@ export default function ScratchpadContainer() { }); }; + const showSidebar = Object.keys(pages).length > 1; + return ( -
+
{Object.keys(pages).map((key) => { const Component = pages[key].icon; return (