diff --git a/client/src/app.css b/client/src/app.css index 5292e3d..3a13568 100644 --- a/client/src/app.css +++ b/client/src/app.css @@ -2,6 +2,8 @@ :root { --clr-primary: #1976d2; + --clr-light-gray: #ddd; + --clr-dark-gray: #aaa; --clr-code: rgba(0, 32, 90, 0.87); --ff-primary: Roboto; --ff-code: "Roboto Mono"; @@ -54,7 +56,13 @@ code { } .btn-disabled, .btn[disabled] { - color: #aaa; + color: var(--clr-dark-gray); + background: var(--clr-light-gray); +} + +.btn-inverted.btn-disabled, .btn-inverted.btn[disabled] { + color: var(--clr-dark-gray); + background: white; } /* App Bar */ diff --git a/client/src/components/Level.tsx b/client/src/components/Level.tsx index b685944..04ae774 100644 --- a/client/src/components/Level.tsx +++ b/client/src/components/Level.tsx @@ -58,6 +58,7 @@ function Level() { const [commandLineMode, setCommandLineMode] = useState(true) const [showSidePanel, setShowSidePanel] = useState(true) + const [canUndo, setCanUndo] = useState(true) const toggleSidePanel = () => { setShowSidePanel(!showSidePanel) @@ -114,6 +115,8 @@ function Level() { const onDidChangeContent = (code) => { dispatch(codeEdited({world: worldId, level: levelId, code})) + + setCanUndo(code.trim() !== "") } const initialCode = useSelector(selectCode(worldId, levelId)) @@ -157,7 +160,7 @@ function Level() {
- {commandLineMode && } + {commandLineMode && } { setCommandLineMode(!commandLineMode) }} />} label="Editor mode" />