From 9c0c2dab903369f52ecac9c9bd2240ea8b8fe2a9 Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Tue, 13 May 2025 16:33:25 +0200 Subject: [PATCH 1/2] trying to simplify things a bit more... will get rid of 'onResolve' --- src/App.tsx | 15 +++++++++------ src/CallBlock.css | 20 +++++++++++++++++--- src/CallBlock.tsx | 20 ++++++++++++-------- src/Editor.css | 2 +- src/Editor.tsx | 28 +++++++++++++++------------- src/InputBlock.tsx | 36 ++++++++++++++++++++++-------------- src/index.css | 9 +++++++++ 7 files changed, 85 insertions(+), 45 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 42d9d1a..42f7b44 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -50,11 +50,11 @@ export function App() { window.onkeydown = onKeyDown; }, []); - const commands = [ - ["call" , "[c] call" ], - ["eval" , "[e] [Tab] [Enter] eval"], - ["transform", "[t] [.] transform" ], - ["let" , "[l] [=] let ... in ..." ], + const commands: [string, string[], string][] = [ + ["call" , ['c' ], "call" ], + ["eval" , ['e','Tab','Enter' ], "eval" ], + ["transform", ['t', '.' ], "transform" ], + ["let" , ['l', '=', 'a' ], "let ... in ..."], ]; const [highlighted, setHighlighted] = useState( @@ -74,8 +74,9 @@ export function App() { Commands: { - commands.map(([_, descr], i) => + commands.map(([_, keys, descr], i) => + {keys.map((key, j) => {key})} {descr} ) } @@ -91,6 +92,8 @@ export function App() { filter={() => true} /> + +