diff --git a/src/App/BottomPanel.tsx b/src/App/BottomPanel.tsx index b829fc6..27d31ce 100644 --- a/src/App/BottomPanel.tsx +++ b/src/App/BottomPanel.tsx @@ -6,9 +6,10 @@ import "./BottomPanel.css"; import head from "../head.svg" ; import { usePersistentState } from "@/util/persistent_state"; import { PersistentDetails } from "./PersistentDetails"; +import { DigitalWatch } from "@/Plant/DigitalWatch/DigitalWatch"; export function BottomPanel(props: {errors: TraceableError[]}) { - const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!"); + const [greeting, setGreeting] = useState(<> "Welcome to StateBuddy, buddy!"
); useEffect(() => { setTimeout(() => { @@ -17,7 +18,8 @@ export function BottomPanel(props: {errors: TraceableError[]}) { }, []); return
- <>{greeting} + {greeting} + {props.errors.length > 0 &&
diff --git a/src/App/TextDialog.tsx b/src/App/TextDialog.tsx index f524ec8..627aa04 100644 --- a/src/App/TextDialog.tsx +++ b/src/App/TextDialog.tsx @@ -1,9 +1,10 @@ -import { Dispatch, ReactElement, SetStateAction, useState, KeyboardEvent } from "react"; +import { Dispatch, ReactElement, SetStateAction, useState, KeyboardEvent, useEffect, useRef } from "react"; import { parse as parseLabel } from "../statecharts/label_parser"; export function TextDialog(props: {setModal: Dispatch>, text: string, done: (newText: string|undefined) => void}) { const [text, setText] = useState(props.text); + function onKeyDown(e: KeyboardEvent) { if (e.key === "Enter") { if (!e.shiftKey) { @@ -19,19 +20,19 @@ export function TextDialog(props: {setModal: Dispatch Text label:
-