From a5dc2c98a0b205757404902087a8d141e3e8604f Mon Sep 17 00:00:00 2001 From: David Ralph Date: Thu, 30 Sep 2021 17:48:38 +0100 Subject: [PATCH] fix: various settings tabs --- .../modals/main/settings/sections/Date.jsx | 2 +- .../main/settings/sections/Keybinds.jsx | 47 ++++++++++--------- .../modals/main/settings/sections/Navbar.jsx | 3 +- .../sections/background/Background.jsx | 2 +- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/components/modals/main/settings/sections/Date.jsx b/src/components/modals/main/settings/sections/Date.jsx index e194c134..66e29b1d 100644 --- a/src/components/modals/main/settings/sections/Date.jsx +++ b/src/components/modals/main/settings/sections/Date.jsx @@ -51,7 +51,7 @@ export default class DateSettings extends PureComponent { return ( <> -
+
this.setState({ dateType: value })} category='date'> diff --git a/src/components/modals/main/settings/sections/Keybinds.jsx b/src/components/modals/main/settings/sections/Keybinds.jsx index 4684ec96..f93ddb27 100644 --- a/src/components/modals/main/settings/sections/Keybinds.jsx +++ b/src/components/modals/main/settings/sections/Keybinds.jsx @@ -61,8 +61,10 @@ export default class KeybindSettings extends PureComponent { cancel(type) { document.removeEventListener('keydown', this.keydown); document.removeEventListener('keyup', this.keyup); + const currentKeybinds = this.state.keybinds; delete currentKeybinds[type]; + this.setState({ keybinds: currentKeybinds }); @@ -73,6 +75,7 @@ export default class KeybindSettings extends PureComponent { const keybinds = this.state.keybinds; keybinds[type] = ''; localStorage.setItem('keybinds', JSON.stringify(keybinds)); + this.setState({ keybinds: JSON.parse(localStorage.getItem('keybinds')) || {} }); @@ -101,27 +104,29 @@ export default class KeybindSettings extends PureComponent { <>
- - - - - - - - - - - - - - - - - - - - -
this.action(type, e)}/> this.action(type, e)}/> this.action(type, e)}/>
this.action(type, e)}/> this.action(type, e)}/> this.action(type, e)}/>
this.action(type, e)}/> this.action(type, e)}/> this.action(type, e)}/>
this.action(type, e)}/> this.action(type, e)}/> this.action(type, e)}/>
+ + + this.action(type, e)}/> + this.action(type, e)}/> + this.action(type, e)}/> + + + this.action(type, e)}/> + this.action(type, e)}/> + this.action(type, e)}/> + + + this.action(type, e)}/> + this.action(type, e)}/> + this.action(type, e)}/> + + + this.action(type, e)}/> + this.action(type, e)}/> + this.action(type, e)}/> + + + ); } diff --git a/src/components/modals/main/settings/sections/Navbar.jsx b/src/components/modals/main/settings/sections/Navbar.jsx index 2e5e04a2..0b355b62 100644 --- a/src/components/modals/main/settings/sections/Navbar.jsx +++ b/src/components/modals/main/settings/sections/Navbar.jsx @@ -2,7 +2,6 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; -import Header from '../Header'; import Checkbox from '../Checkbox'; import Dropdown from '../Dropdown'; import Slider from '../Slider'; @@ -13,7 +12,7 @@ export default class Navbar extends PureComponent { return ( <> -
+

{getMessage('modals.main.settings.sections.appearance.navbar.title')}

diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 5e83bf08..d48a8b2e 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -123,7 +123,7 @@ export default class BackgroundSettings extends PureComponent { return ( <> -
+