feat: better keybinds ui, fix notes, improve search dropdown etc

This commit is contained in:
David Ralph
2021-09-04 12:20:58 +01:00
parent 3cc8031c84
commit 7f71321e67
14 changed files with 70 additions and 75 deletions

View File

@@ -0,0 +1,22 @@
export default function KeybindInput(props) {
const language = window.language.modals.main.settings;
const getButton = () => {
const value = props.state[props.settingsName];
if (!value) {
return null;
} else if (value === language.sections.keybinds.recording) {
return <span className='modalLink' onClick={() => props.cancel(props.settingsName)}>{language.sections.advanced.reset_modal.cancel}</span>
} else {
return <span className='modalLink' onClick={() => props.reset(props.settingsName)}>{language.buttons.reset}</span>;
}
}
return (
<>
<p>{props.name}</p>
<input type='text' onClick={() => props.set(props.settingsName)} value={props.state[props.settingsName] || language.sections.keybinds.click_to_record} readOnly/>
{getButton()}
</>
);
}