From b4e1d00633fae454d8b6673a6b0791f3e852540d Mon Sep 17 00:00:00 2001 From: David Ralph Date: Tue, 23 Mar 2021 12:23:21 +0000 Subject: [PATCH] perf: improve dropdowns --- .../modals/main/scss/settings/_dropdown.scss | 22 +++++++---------- .../modals/main/settings/Dropdown.jsx | 10 ++++---- .../main/settings/sections/Appearance.jsx | 22 ++++++++--------- .../main/settings/sections/Background.jsx | 4 ++-- .../main/settings/sections/Language.jsx | 4 ++-- .../modals/main/settings/sections/Search.jsx | 14 +++++------ .../modals/main/settings/sections/Time.jsx | 24 +++++++++---------- 7 files changed, 45 insertions(+), 55 deletions(-) diff --git a/src/components/modals/main/scss/settings/_dropdown.scss b/src/components/modals/main/scss/settings/_dropdown.scss index c2c13bc7..137e1160 100644 --- a/src/components/modals/main/scss/settings/_dropdown.scss +++ b/src/components/modals/main/scss/settings/_dropdown.scss @@ -1,17 +1,11 @@ -.dropdown { - select { - margin-left: 10px; - width: 120px; - color: var(--modal-text); - background: var(--sidebar); - border: none; - padding: 10px 10px; - border-radius: 5px; - } - - select#language { - float: right; - } +select { + margin-left: 10px; + width: 120px; + color: var(--modal-text); + background: var(--sidebar); + border: none; + padding: 10px 10px; + border-radius: 5px; } // firefox dropdown diff --git a/src/components/modals/main/settings/Dropdown.jsx b/src/components/modals/main/settings/Dropdown.jsx index c1fb64fb..96e6a6e8 100644 --- a/src/components/modals/main/settings/Dropdown.jsx +++ b/src/components/modals/main/settings/Dropdown.jsx @@ -9,7 +9,7 @@ export default class Dropdown extends React.PureComponent { } getLabel() { - return this.props.label ? : null; + return this.props.label ? : null; } onChange(value) { @@ -28,11 +28,9 @@ export default class Dropdown extends React.PureComponent { return ( <> {this.getLabel()} -
- -
+ ); } diff --git a/src/components/modals/main/settings/sections/Appearance.jsx b/src/components/modals/main/settings/sections/Appearance.jsx index 06c26fb8..75683336 100644 --- a/src/components/modals/main/settings/sections/Appearance.jsx +++ b/src/components/modals/main/settings/sections/Appearance.jsx @@ -39,20 +39,20 @@ export default function AppearanceSettings() { {/* names are taken from https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight */} - - - - - - - - + + + + + + + +

- - - + + +

{appearance.accessibility.title}

diff --git a/src/components/modals/main/settings/sections/Background.jsx b/src/components/modals/main/settings/sections/Background.jsx index 4e39033f..86f7e504 100644 --- a/src/components/modals/main/settings/sections/Background.jsx +++ b/src/components/modals/main/settings/sections/Background.jsx @@ -213,8 +213,8 @@ export default class BackgroundSettings extends React.PureComponent {

{background.source.title}

- - + + {/* */ }
    diff --git a/src/components/modals/main/settings/sections/Language.jsx b/src/components/modals/main/settings/sections/Language.jsx index 41249d23..8aaeb8b2 100644 --- a/src/components/modals/main/settings/sections/Language.jsx +++ b/src/components/modals/main/settings/sections/Language.jsx @@ -14,8 +14,8 @@ export default function LanguageSettings() {
    - - + + ); diff --git a/src/components/modals/main/settings/sections/Search.jsx b/src/components/modals/main/settings/sections/Search.jsx index 38d2994d..db09ca51 100644 --- a/src/components/modals/main/settings/sections/Search.jsx +++ b/src/components/modals/main/settings/sections/Search.jsx @@ -62,14 +62,12 @@ export default class SearchSettings extends React.PureComponent {

    {search.title}

    -
      - this.setSearchEngine(value)}> - {searchEngines.map((engine) => - - )} - - -
    + this.setSearchEngine(value)}> + {searchEngines.map((engine) => + + )} + +

      {search.custom} this.resetSearch()}>{language.reset}

      diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index 172a83d2..296e6fdb 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -71,16 +71,16 @@ export default class TimeSettings extends React.PureComponent { <>
      - - - + + +

      - - - - + + + + ); @@ -95,17 +95,17 @@ export default class TimeSettings extends React.PureComponent {

      {time.title}

      this.setState({ timeType: value })}> - - - + + + {timeSettings}

      {time.date.title}

      this.setState({ dateType: value })}> - - + +
      {dateSettings}