Refactors to address CR
This commit is contained in:
parent
a563898a5f
commit
38a0e78873
|
@ -252,10 +252,10 @@ export const SquiggleItem: React.FC<SquiggleItemProps> = ({
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return (
|
return (
|
||||||
<>
|
<div>
|
||||||
<span>No display for type: </span>{" "}
|
<span>No display for type: </span>{" "}
|
||||||
<span className="font-semibold text-slate-600">{expression.tag}</span>
|
<span className="font-semibold text-slate-600">{expression.tag}</span>
|
||||||
</>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,25 +384,31 @@ export const SquigglePlayground: FC<PlaygroundProps> = ({
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const InFirstTab: React.FC<{ children: React.ReactNode }> = ({
|
||||||
|
children,
|
||||||
|
}) => (
|
||||||
|
<Tab.Panels>
|
||||||
|
<Tab.Panel>{children}</Tab.Panel>
|
||||||
|
<Tab.Panel>{samplingSettings}</Tab.Panel>
|
||||||
|
<Tab.Panel>{viewSettings}</Tab.Panel>
|
||||||
|
<Tab.Panel>{inputVariableSettings}</Tab.Panel>
|
||||||
|
</Tab.Panels>
|
||||||
|
);
|
||||||
|
|
||||||
let withEditor = (
|
let withEditor = (
|
||||||
<div className="flex mt-1" style={{ height }}>
|
<div className="flex mt-1" style={{ height }}>
|
||||||
<div className="w-1/2">
|
<div className="w-1/2">
|
||||||
<Tab.Panels>
|
<InFirstTab>
|
||||||
<Tab.Panel>
|
<div className="border border-slate-200">
|
||||||
<div className="border border-slate-200">
|
<CodeEditor
|
||||||
<CodeEditor
|
value={squiggleString}
|
||||||
value={squiggleString}
|
onChange={setSquiggleString}
|
||||||
onChange={setSquiggleString}
|
oneLine={false}
|
||||||
oneLine={false}
|
showGutter={true}
|
||||||
showGutter={true}
|
height={height - 1}
|
||||||
height={height - 1}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
</InFirstTab>
|
||||||
</Tab.Panel>
|
|
||||||
<Tab.Panel>{samplingSettings}</Tab.Panel>
|
|
||||||
<Tab.Panel>{viewSettings}</Tab.Panel>
|
|
||||||
<Tab.Panel>{inputVariableSettings}</Tab.Panel>
|
|
||||||
</Tab.Panels>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="w-1/2 p-2 pl-4">
|
<div className="w-1/2 p-2 pl-4">
|
||||||
|
@ -423,24 +429,19 @@ export const SquigglePlayground: FC<PlaygroundProps> = ({
|
||||||
|
|
||||||
let withoutEditor = (
|
let withoutEditor = (
|
||||||
<div className="mt-3">
|
<div className="mt-3">
|
||||||
<Tab.Panels>
|
<InFirstTab>
|
||||||
<Tab.Panel>
|
<SquiggleChart
|
||||||
<SquiggleChart
|
squiggleString={squiggleString}
|
||||||
squiggleString={squiggleString}
|
environment={env}
|
||||||
environment={env}
|
chartSettings={chartSettings}
|
||||||
chartSettings={chartSettings}
|
height={vars.chartHeight}
|
||||||
height={vars.chartHeight}
|
showTypes={vars.showTypes}
|
||||||
showTypes={vars.showTypes}
|
showControls={vars.showControls}
|
||||||
showControls={vars.showControls}
|
bindings={defaultBindings}
|
||||||
bindings={defaultBindings}
|
jsImports={imports}
|
||||||
jsImports={imports}
|
showSummary={vars.showSummary}
|
||||||
showSummary={vars.showSummary}
|
/>
|
||||||
/>
|
</InFirstTab>
|
||||||
</Tab.Panel>
|
|
||||||
<Tab.Panel>{samplingSettings}</Tab.Panel>
|
|
||||||
<Tab.Panel>{viewSettings}</Tab.Panel>
|
|
||||||
<Tab.Panel>{inputVariableSettings}</Tab.Panel>
|
|
||||||
</Tab.Panels>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user