From 7a878bd0d77fbe8fc2e3e3a341c9c7e3e4e8f6d2 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 20 Jun 2021 11:33:18 +0200 Subject: added KeybindSelector component beginnings --- components/keybindselector.tsx | 32 ++++++++++++++++++++++++++++++++ pages/_app.tsx | 1 + pages/editor.tsx | 7 +++++++ styles/keybindselector.css | 18 ++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 components/keybindselector.tsx create mode 100644 styles/keybindselector.css diff --git a/components/keybindselector.tsx b/components/keybindselector.tsx new file mode 100644 index 0000000..084d748 --- /dev/null +++ b/components/keybindselector.tsx @@ -0,0 +1,32 @@ +import FilledInput from '@material-ui/core/FilledInput'; +import FormControl from '@material-ui/core/FormControl'; +import InputLabel from '@material-ui/core/InputLabel'; +import { useState } from 'react'; +import { v4 as uuid } from 'uuid'; + +function Keybind(props: { + keyName: string; +}) { + return {props.keyName}; +} + +function KeybindSelectorInner(props: { + value: string[]; +}) { + return
+ {props.value.map(s => )} +
; +} + +export default function KeybindSelector(props: { + label: string; + value: string[]; + onChange?: (newValue: string[]) => any; +}) { + var [tempID, _setTempID] = useState(uuid()); + + return + {props.label} + } /> + ; +} diff --git a/pages/_app.tsx b/pages/_app.tsx index 9dc0a1e..20708b3 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,6 +4,7 @@ import '../components/play-skip_60fps.css'; import '../styles/colors.css'; import '../styles/editor.css'; import '../styles/globals.css'; +import '../styles/keybindselector.css'; import '../styles/keyframes.css'; import '../styles/paper.css'; import '../styles/presentation.css'; diff --git a/pages/editor.tsx b/pages/editor.tsx index ff85c87..73bcd93 100644 --- a/pages/editor.tsx +++ b/pages/editor.tsx @@ -10,6 +10,7 @@ import { PressureIcon, SlideKeyframe, } from '../components/icons'; +import KeybindSelector from '../components/keybindselector'; import PlaySkipIconAni from '../components/play-skip'; import Selection from '../components/selection'; import { anySlide, loopBeginSlide, loopSlide, slide, slideTypes, toolToSlide } from '../timeline'; @@ -690,6 +691,12 @@ function DefaultSettings() { +
+ Keybindings + + + +
Cool temporary buttons