From d6ecc9bc8bfbcb3e5919638c4166360ec81531f1 Mon Sep 17 00:00:00 2001 From: Alan Smith Date: Mon, 30 Jun 2025 15:08:56 -0400 Subject: [PATCH 1/2] Changes code to sider, colors --- src/App.tsx | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1813d73c..ee2612cd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -95,6 +95,8 @@ const App: React.FC = (): React.JSX.Element => { const [shownPythonToolboxCategories, setShownPythonToolboxCategories] = React.useState>(new Set()); const [triggerPythonRegeneration, setTriggerPythonRegeneration] = React.useState(0); const [leftCollapsed, setLeftCollapsed] = React.useState(false); + const [rightCollapsed, setRightCollapsed] = React.useState(false); + const blocksEditor = React.useRef(null); const generatorContext = React.useRef(null); @@ -210,11 +212,6 @@ const App: React.FC = (): React.JSX.Element => { setCurrentModule(module); }; - /** Handles left sidebar collapse state change. */ - const handleSiderCollapse = (collapsed: boolean): void => { - setLeftCollapsed(collapsed); - }; - /** Handles toolbox settings modal close. */ const handleToolboxSettingsCancel = (): void => { setToolboxSettingsModalIsOpen(false); @@ -337,21 +334,21 @@ const App: React.FC = (): React.JSX.Element => { } }, [project]); - const {Sider} = Antd.Layout; + const {Sider,Content} = Antd.Layout; return ( @@ -371,7 +368,7 @@ const App: React.FC = (): React.JSX.Element => { setLeftCollapsed(collapsed)} > { setProject={setProject} storage={storage} /> - - + + - - + setRightCollapsed(collapsed)} > - - + + From a753501a003a0e6800b4b86b797c14aac895b54c Mon Sep 17 00:00:00 2001 From: Alan Smith Date: Mon, 30 Jun 2025 15:13:17 -0400 Subject: [PATCH 2/2] Changed to use constants instead of magic numbers --- src/App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ee2612cd..b83651d7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -73,7 +73,7 @@ const FULL_HEIGHT = '100%'; const CODE_PANEL_DEFAULT_SIZE = '25%'; /** Minimum size for code panel. */ -const CODE_PANEL_MIN_SIZE = 40; +const CODE_PANEL_MIN_SIZE = 80; /** Background color for testing layout. */ const LAYOUT_BACKGROUND_COLOR = '#0F0'; @@ -399,8 +399,8 @@ const App: React.FC = (): React.JSX.Element => { collapsible reverseArrow={true} collapsed={rightCollapsed} - collapsedWidth={80} - width={'25%'} + collapsedWidth={CODE_PANEL_MIN_SIZE} + width={CODE_PANEL_DEFAULT_SIZE} onCollapse={(collapsed: boolean) => setRightCollapsed(collapsed)} >