diff --git a/packages/components/src/components/SquigglePlayground.tsx b/packages/components/src/components/SquigglePlayground.tsx index 50c37980..1dcedbdd 100644 --- a/packages/components/src/components/SquigglePlayground.tsx +++ b/packages/components/src/components/SquigglePlayground.tsx @@ -394,18 +394,7 @@ export const SquigglePlayground: FC = ({ ); - const InFirstTab: React.FC<{ children: React.ReactNode }> = ({ - children, - }) => ( - - {children} - {samplingSettings} - {viewSettings} - {inputVariableSettings} - - ); - - let squiggleChart = ( + const squiggleChart = ( = ({ /> ); - let withEditor = ( -
-
- -
- { - if (controlledCode === undefined) { - // uncontrolled mode - setUncontrolledCode(newCode); - } - onCodeChange?.(newCode); - }} - oneLine={false} - showGutter={true} - height={height - 1} - /> -
-
-
+ const firstTab = vars.showEditor ? ( +
+ { + if (controlledCode === undefined) { + // uncontrolled mode + setUncontrolledCode(newCode); + } + onCodeChange?.(newCode); + }} + oneLine={false} + showGutter={true} + height={height - 1} + /> +
+ ) : ( + squiggleChart + ); + const tabs = ( + + {firstTab} + {samplingSettings} + {viewSettings} + {inputVariableSettings} + + ); + + const withEditor = ( +
+
{tabs}
{squiggleChart}
); - let withoutEditor = ( -
- {squiggleChart} -
- ); + const withoutEditor =
{tabs}
; return (