diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index 53f405b7..5ee6f9ad 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -118,7 +118,8 @@ span.modalLink { } h2 { - font-size: 1.5rem; + font-size: 2rem; + margin-bottom: 0; } h3 { diff --git a/src/components/modals/main/scss/modules/_tab-content.scss b/src/components/modals/main/scss/modules/_tab-content.scss index 9047e1db..409bc46e 100644 --- a/src/components/modals/main/scss/modules/_tab-content.scss +++ b/src/components/modals/main/scss/modules/_tab-content.scss @@ -31,7 +31,6 @@ (min-width: 1400px) { .tab-content { left: 350px; - top: 75px; } } diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index 63320151..549d5c0f 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -83,3 +83,7 @@ input { h4 { cursor: pointer; } + +.keybind-table { + text-align: left; +} diff --git a/src/components/modals/main/scss/settings/modules/tabs/_order.scss b/src/components/modals/main/scss/settings/modules/tabs/_order.scss index 1ed538c0..14c887e6 100644 --- a/src/components/modals/main/scss/settings/modules/tabs/_order.scss +++ b/src/components/modals/main/scss/settings/modules/tabs/_order.scss @@ -15,8 +15,7 @@ } &:hover { - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.15); - transition: 0.3s; + background: var(--tab-active) !important; } } diff --git a/src/components/modals/main/settings/Header.jsx b/src/components/modals/main/settings/Header.jsx new file mode 100644 index 00000000..b7a5a10b --- /dev/null +++ b/src/components/modals/main/settings/Header.jsx @@ -0,0 +1,22 @@ +import variables from 'modules/variables'; + +import { PureComponent } from 'react'; + +import Slider from './Slider'; +import Switch from './Switch'; + +export default class Header extends PureComponent { + render() { + const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); + + return ( + <> +

{this.props.title}

+ + {this.props.zoomSetting ? + <>

+ : null} + + ); + } +} diff --git a/src/components/modals/main/settings/KeybindInput.jsx b/src/components/modals/main/settings/KeybindInput.jsx index a5b5b204..0af26527 100644 --- a/src/components/modals/main/settings/KeybindInput.jsx +++ b/src/components/modals/main/settings/KeybindInput.jsx @@ -1,15 +1,16 @@ import variables from 'modules/variables'; +import { Cancel } from '@mui/icons-material'; export default function KeybindInput(props) { const value = props.state[props.setting]; const getButton = () => { if (!value) { - return null; + return ;; } else if (value === variables.language.getMessage(variables.languagecode, 'modals.main.settings.sections.keybinds.recording')) { return props.action('cancel', props.setting)}>{variables.language.getMessage(variables.languagecode, 'modals.main.settings.sections.advanced.reset_modal.cancel')} } else { - return props.action('reset', props.setting)}>{variables.language.getMessage(variables.languagecode, 'modals.main.settings.buttons.reset')}; + return ; } } diff --git a/src/components/modals/main/settings/sections/Date.jsx b/src/components/modals/main/settings/sections/Date.jsx index c98d9c75..7bf89cd5 100644 --- a/src/components/modals/main/settings/sections/Date.jsx +++ b/src/components/modals/main/settings/sections/Date.jsx @@ -1,10 +1,9 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; +import Header from '../Header'; import Checkbox from '../Checkbox'; import Dropdown from '../Dropdown'; -import Switch from '../Switch'; -import Slider from '../Slider'; export default class DateSettings extends PureComponent { constructor() { @@ -52,8 +51,7 @@ export default class DateSettings extends PureComponent { return ( <> -

{getMessage('modals.main.settings.sections.time.date.title')}

- +
this.setState({ dateType: value })} category='date'> @@ -62,7 +60,6 @@ export default class DateSettings extends PureComponent { {dateSettings} - ); } diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index a16b31f3..ee4a7b23 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -1,10 +1,10 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; +import Header from '../Header'; import Checkbox from '../Checkbox'; import Switch from '../Switch'; import Text from '../Text'; -import Slider from '../Slider'; export default class GreetingSettings extends PureComponent { constructor() { @@ -23,22 +23,19 @@ export default class GreetingSettings extends PureComponent { } render() { - const getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text); - const languagecode = variables.languagecode; + const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); return ( <> -

{getMessage(languagecode, 'modals.main.settings.sections.greeting.title')}

- - - - - +
+ + + -

{getMessage(languagecode, 'modals.main.settings.sections.greeting.birthday')}

- - -

{getMessage(languagecode, 'modals.main.settings.sections.greeting.birthday_date')}

+

{getMessage('modals.main.settings.sections.greeting.birthday')}

+ + +

{getMessage('modals.main.settings.sections.greeting.birthday_date')}

); diff --git a/src/components/modals/main/settings/sections/Keybinds.jsx b/src/components/modals/main/settings/sections/Keybinds.jsx index fff24f68..fe57b3a4 100644 --- a/src/components/modals/main/settings/sections/Keybinds.jsx +++ b/src/components/modals/main/settings/sections/Keybinds.jsx @@ -29,18 +29,25 @@ export default class KeybindSettings extends PureComponent { this.forceUpdate(); let keys = ''; + let previouskey = ''; this.keydown = document.addEventListener('keydown', (event) => { + if (event.key === previouskey) { + return; + } + if (keys === '') { keys = event.key; } else { keys = `${keys}+${event.key}`; } + + previouskey = event.key }); this.keyup = document.addEventListener('keyup', () => { document.removeEventListener('keydown', this.keydown); const keybinds = this.state.keybinds; - keybinds[type] = keys; + keybinds[type] = keys.split('+').slice(0, 4).join('+'); localStorage.setItem('keybinds', JSON.stringify(keybinds)); this.setState({ keybinds: JSON.parse(localStorage.getItem('keybinds')) || {} @@ -97,18 +104,28 @@ export default class KeybindSettings extends PureComponent { <>

{getMessage(languagecode, 'modals.main.settings.sections.keybinds.title')}

- 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/Message.jsx b/src/components/modals/main/settings/sections/Message.jsx index c4efef74..92db48a1 100644 --- a/src/components/modals/main/settings/sections/Message.jsx +++ b/src/components/modals/main/settings/sections/Message.jsx @@ -3,14 +3,13 @@ import { PureComponent, Fragment } from 'react'; import { Cancel } from '@mui/icons-material'; import { toast } from 'react-toastify'; -import Switch from '../Switch'; +import Header from '../Header'; import Slider from '../Slider'; import EventBus from 'modules/helpers/eventbus'; export default class Message extends PureComponent { - getMessage = (languagecode, text) => variables.language.getMessage(languagecode, text); - languagecode = variables.languagecode; + getMessage = (text) => variables.language.getMessage(variables.languagecode, text); constructor() { super(); @@ -62,9 +61,8 @@ export default class Message extends PureComponent { render() { return ( <> -

{this.getMessage(this.languagecode, 'modals.main.settings.sections.message.title')}

- -

{this.getMessage(this.languagecode, 'modals.main.settings.sections.message.text')}

+
+

{this.getMessage('modals.main.settings.sections.message.text')}

{this.state.messages.map((_url, index) => ( this.message(e, true, index)}> @@ -74,8 +72,8 @@ export default class Message extends PureComponent {

))} - - + + ); } diff --git a/src/components/modals/main/settings/sections/Navbar.jsx b/src/components/modals/main/settings/sections/Navbar.jsx index 0ea958f4..2e5e04a2 100644 --- a/src/components/modals/main/settings/sections/Navbar.jsx +++ b/src/components/modals/main/settings/sections/Navbar.jsx @@ -1,28 +1,33 @@ 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'; -export default function NavbarSettings() { - const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); +export default class Navbar extends PureComponent { + render() { + const getMessage = (text) => variables.language.getMessage(variables.languagecode, text); - return ( - <> -

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

- - - - - - - - - {/* before it was just a checkbox */} - - -
- - - ); + return ( + <> +
+ + + + + + + + + {/* before it was just a checkbox */} + + +
+ + + ); + } } diff --git a/src/components/modals/main/settings/sections/Order.jsx b/src/components/modals/main/settings/sections/Order.jsx index 04ce1e3a..ea585147 100644 --- a/src/components/modals/main/settings/sections/Order.jsx +++ b/src/components/modals/main/settings/sections/Order.jsx @@ -35,22 +35,12 @@ export default class OrderSettings extends PureComponent { }; } - // based on https://stackoverflow.com/a/48301905 arrayMove(array, oldIndex, newIndex) { - if (oldIndex === newIndex) { - return array; - } + const result = Array.from(array); + const [removed] = result.splice(oldIndex, 1); + result.splice(newIndex, 0, removed); - const newArray = [...array]; - const target = newArray[oldIndex]; - const inc = newIndex < oldIndex ? -1 : 1; - - for (let i = oldIndex; i !== newIndex; i += inc) { - newArray[i] = newArray[i + inc]; - } - - newArray[newIndex] = target; - return newArray; + return result; } onSortEnd = ({ oldIndex, newIndex }) => { diff --git a/src/components/modals/main/settings/sections/QuickLinks.jsx b/src/components/modals/main/settings/sections/QuickLinks.jsx index 5b49eeaa..249cf1f0 100644 --- a/src/components/modals/main/settings/sections/QuickLinks.jsx +++ b/src/components/modals/main/settings/sections/QuickLinks.jsx @@ -1,6 +1,6 @@ import variables from 'modules/variables'; -import Switch from '../Switch'; +import Header from '../Header'; import Checkbox from '../Checkbox'; import Slider from '../Slider'; @@ -9,8 +9,7 @@ export default function QuickLinks() { return ( <> -

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

- +
diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/components/modals/main/settings/sections/Quote.jsx index a4e2d4a4..f2d3c0c0 100644 --- a/src/components/modals/main/settings/sections/Quote.jsx +++ b/src/components/modals/main/settings/sections/Quote.jsx @@ -2,9 +2,8 @@ import variables from 'modules/variables'; import { PureComponent, Fragment } from 'react'; import { Cancel } from '@mui/icons-material'; +import Header from '../Header'; import Checkbox from '../Checkbox'; -import Switch from '../Switch'; -import Slider from '../Slider'; import Dropdown from '../Dropdown'; export default class QuoteSettings extends PureComponent { @@ -120,8 +119,7 @@ export default class QuoteSettings extends PureComponent { return ( <> -

{this.getMessage('modals.main.settings.sections.quote.title')}

- +
this.setState({ quoteType: value })} category='quote'> {this.marketplaceType()} @@ -129,7 +127,6 @@ export default class QuoteSettings extends PureComponent { {customSettings} -

{this.getMessage('modals.main.settings.sections.quote.buttons.title')}

diff --git a/src/components/modals/main/settings/sections/Search.jsx b/src/components/modals/main/settings/sections/Search.jsx index 08072afa..c669e63e 100644 --- a/src/components/modals/main/settings/sections/Search.jsx +++ b/src/components/modals/main/settings/sections/Search.jsx @@ -2,6 +2,7 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { toast } from 'react-toastify'; +import Header from '../Header'; import Dropdown from '../Dropdown'; import Checkbox from '../Checkbox'; import Switch from '../Switch'; @@ -72,6 +73,7 @@ export default class SearchSettings extends PureComponent { render() { return ( <> +

{this.getMessage('modals.main.settings.sections.search.title')}

{/* not supported on firefox */} diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index 5d46f4b2..c952f72b 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -1,11 +1,10 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; +import Header from '../Header'; import Checkbox from '../Checkbox'; import Dropdown from '../Dropdown'; -import Switch from '../Switch'; import Radio from '../Radio'; -import Slider from '../Slider'; export default class TimeSettings extends PureComponent { constructor() { @@ -60,17 +59,13 @@ export default class TimeSettings extends PureComponent { return ( <> -

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

- +
this.setState({ timeType: value })} category='clock'> {timeSettings} - {this.state.timeType !== 'analogue' ? - - : null} ); } diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 635a1158..dab0539a 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -3,11 +3,11 @@ import { PureComponent, Fragment } from 'react'; import { toast } from 'react-toastify'; import { Cancel } from '@mui/icons-material'; +import Header from '../../Header'; import Checkbox from '../../Checkbox'; import Dropdown from '../../Dropdown'; import FileUpload from '../../FileUpload'; import Slider from '../../Slider'; -import Switch from '../../Switch'; import Radio from '../../Radio'; import ColourSettings from './Colour'; @@ -156,7 +156,7 @@ export default class BackgroundSettings extends PureComponent { const interval = ( <> -

+

@@ -191,25 +191,23 @@ export default class BackgroundSettings extends PureComponent { ); const customSettings = ( - <> -
    -

    {getMessage('modals.main.settings.sections.background.source.custom_background')} {getMessage('modals.main.settings.buttons.reset')}

    - {this.state.customBackground.map((_url, index) => ( - - this.customBackground(e, true, index)}> - {this.state.customBackground.length > 1 ? : null} - this.uploadCustombackground(index)}>{getMessage('modals.main.settings.sections.background.source.upload')} - {this.videoCustomSettings(index)} -

    -
    - ))} - - this.customBackground(e, false, this.state.currentBackgroundIndex)} /> - {interval} -
- +
    +

    {getMessage('modals.main.settings.sections.background.source.custom_background')} {getMessage('modals.main.settings.buttons.reset')}

    + {this.state.customBackground.map((_url, index) => ( + + this.customBackground(e, true, index)}> + {this.state.customBackground.length > 1 ? : null} + this.uploadCustombackground(index)}>{getMessage('modals.main.settings.sections.background.source.upload')} + {this.videoCustomSettings(index)} +

    +
    + ))} + + this.customBackground(e, false, this.state.currentBackgroundIndex)} /> + {interval} +
); switch (this.state.backgroundType) { @@ -224,8 +222,7 @@ export default class BackgroundSettings extends PureComponent { return ( <> -

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

- +
diff --git a/src/components/modals/main/tabs/backend/Tabs.jsx b/src/components/modals/main/tabs/backend/Tabs.jsx index 99c66ac8..ba01b665 100644 --- a/src/components/modals/main/tabs/backend/Tabs.jsx +++ b/src/components/modals/main/tabs/backend/Tabs.jsx @@ -26,12 +26,9 @@ export default class Tabs extends PureComponent { }; render() { - const language = variables.language; - const languagecode = variables.languagecode; - let className = 'sidebar'; let tabClass = 'tab-content'; - let optionsText = (

{language.getMessage(languagecode, 'modals.main.title')}

); + let optionsText = (

{variables.language.getMessage(variables.languagecode, 'modals.main.title')}

); if (this.props.navbar) { className = 'modalNavbar';