diff --git a/src/components/app.tsx b/src/components/app.tsx index be3d2e0..c07c139 100644 --- a/src/components/app.tsx +++ b/src/components/app.tsx @@ -340,7 +340,6 @@ export const App = () => { }, [setFastSimulation]); const uiForGenerate = () => { - const disabled = graphEmpty; const playLabel = generationMode === "playing" ? "Pause" : (generationMode === "paused" ? "Resume" : "Play"); const PlayOrPauseIcon = generationMode === "playing" ? PauseIcon : PlayIcon; const onPlayClick = generationMode === "playing" @@ -357,7 +356,7 @@ export const App = () => {
- {sortedNodes.map(n => )} @@ -370,7 +369,7 @@ export const App = () => { value={lengthLimit} onChange={handleChangeLengthLimit} min={1} - disabled={disabled} + disabled={animating} />
@@ -381,26 +380,26 @@ export const App = () => { value={delimiterValue} placeholder={delimiterPlaceholder} maxLength={3} - disabled={disabled} + disabled={animating} />
- +
diff --git a/src/components/dataset.tsx b/src/components/dataset.tsx index 80f8769..c040261 100644 --- a/src/components/dataset.tsx +++ b/src/components/dataset.tsx @@ -38,6 +38,7 @@ export const Dataset = (props: Props) => { return (
{ return (
{ return (
{ onChange={handleChangeNode} onCancel={handleClearSelectedNode} /> - +
); }; diff --git a/src/components/drawing/add-text.tsx b/src/components/drawing/add-text.tsx index d63e02e..e1367fa 100644 --- a/src/components/drawing/add-text.tsx +++ b/src/components/drawing/add-text.tsx @@ -4,6 +4,7 @@ import { clsx } from "clsx"; import "./add-text.scss"; interface Props { + disabled: boolean; visible: boolean; width: number; onChange: (newText: string) => void @@ -12,14 +13,14 @@ interface Props { // eslint-disable-next-line max-len const placeholder = "Create a Markov chain by typing or pasting text here. WARNING: your current Markov chain will be overwritten."; -export const AddText = forwardRef(({visible, width, onChange}: Props, ref) => { +export const AddText = forwardRef(({disabled, visible, width, onChange}: Props, ref) => { const handleChange = (e: React.ChangeEvent) => { onChange(e.currentTarget.value.trim()); }; return (
-