From ca4392ef05c5aaaac75ce56f2325568858c09c77 Mon Sep 17 00:00:00 2001 From: RheingoldRiver <18037011+RheingoldRiver@users.noreply.github.com> Date: Sat, 4 Nov 2023 02:49:54 -0500 Subject: [PATCH] Adjust settings order --- src/components/Settings/Settings.tsx | 121 +++++++++++++-------------- 1 file changed, 60 insertions(+), 61 deletions(-) diff --git a/src/components/Settings/Settings.tsx b/src/components/Settings/Settings.tsx index 2f818c8..66bf3e2 100644 --- a/src/components/Settings/Settings.tsx +++ b/src/components/Settings/Settings.tsx @@ -251,21 +251,6 @@ export const Settings = () => { {showErrors && errorSphere(currentState) && ( {currentState.surface.name} requires equal width & height )} - Hotkey preferences -
- - { - setCurrentState({ ...currentState, showKeyboardIndicators: e.target.checked }); - }} - /> -
Pentomino tile colors Click & drag to rearrange
@@ -390,53 +375,67 @@ export const Settings = () => { }} />
+ Hotkeys +
+ + { + setCurrentState({ ...currentState, showKeyboardIndicators: e.target.checked }); + }} + /> +
+
+ You can also undo with Ctrl+Z. +
+ {currentHotkeyMap.map((hotkey, i) => { + return ( +
+ + { + e.preventDefault(); + e.stopPropagation(); + if (e.key === hotkey.keybind) return; + setCurrentHotkeyMap( + produce(currentHotkeyMap, (draftHotkeyMap) => { + if (e.key === " ") { + draftHotkeyMap[i].keybind = "Space"; + return; + } + draftHotkeyMap[i].keybind = e.key.length === 1 ? e.key.toUpperCase() : e.key; + }) + ); + }} + onChange={() => {}} + /> + {duplicateKeybindsAtLetter(currentHotkeyMap, hotkey.keybind) && ( + + )} +
+ ); + })} + - Hotkeys -
- You can also undo with Ctrl+Z. -
- {currentHotkeyMap.map((hotkey, i) => { - return ( -
- - { - e.preventDefault(); - e.stopPropagation(); - if (e.key === hotkey.keybind) return; - setCurrentHotkeyMap( - produce(currentHotkeyMap, (draftHotkeyMap) => { - if (e.key === " ") { - draftHotkeyMap[i].keybind = "Space"; - return; - } - draftHotkeyMap[i].keybind = e.key.length === 1 ? e.key.toUpperCase() : e.key; - }) - ); - }} - onChange={() => {}} - /> - {duplicateKeybindsAtLetter(currentHotkeyMap, hotkey.keybind) && ( - - )} -
- ); - })} - {/* End of settings area */} {/* Start confirmation area */}