diff --git a/src/components/ErrorBoundary.jsx b/src/components/ErrorBoundary.jsx new file mode 100644 index 00000000..514e5891 --- /dev/null +++ b/src/components/ErrorBoundary.jsx @@ -0,0 +1,27 @@ +import React from 'react'; + +export default class ErrorBoundary extends React.PureComponent { + constructor(props) { + super(props); + this.state = { hasError: false, error: '' }; + } + + static getDerivedStateFromError(error) { + console.log(error); + return { hasError: true, error: error }; + } + + render() { + if (this.state.hasError) { + return ( +
+

Error

+

Failed to load this component of Mue.

+ +
+ ) + } + + return this.props.children; + } + } \ No newline at end of file diff --git a/src/components/modals/settings/sections/Appearance.jsx b/src/components/modals/settings/sections/Appearance.jsx index 7f16586c..05da9056 100644 --- a/src/components/modals/settings/sections/Appearance.jsx +++ b/src/components/modals/settings/sections/Appearance.jsx @@ -4,11 +4,11 @@ import Checkbox from '../Checkbox'; export default function AppearanceSettings (props) { return (
-

Appearance

+

{props.language.title}

- +

Accessibility

- +

    Zoom (100%) {props.language.reset}

    diff --git a/src/components/modals/settings/sections/Background.jsx b/src/components/modals/settings/sections/Background.jsx index ed7bb597..c1734989 100644 --- a/src/components/modals/settings/sections/Background.jsx +++ b/src/components/modals/settings/sections/Background.jsx @@ -210,7 +210,7 @@ export default class BackgroundSettings extends React.PureComponent {
    {gradientInputs} {this.state.gradientSettings.gradient[0].colour !== this.props.language.background.disabled && - !gradientHasMoreThanOneColour ? () : null + !gradientHasMoreThanOneColour ? () : null }
    ); @@ -222,23 +222,23 @@ export default class BackgroundSettings extends React.PureComponent {

    Buttons

      - - - + + +

    Effects

      -

      {this.props.language.background.blur} ({this.state.blur}%) this.resetItem('blur')}>{this.props.language.reset}

      +

      {this.props.language.blur} ({this.state.blur}%) this.resetItem('blur')}>{this.props.language.reset}

      this.setState({ blur: event.target.value })} />
      -

      {this.props.language.background.brightness} ({this.state.brightness}%) this.resetItem('brightness')}>{this.props.language.reset}

      +

      {this.props.language.brightness} ({this.state.brightness}%) this.resetItem('brightness')}>{this.props.language.reset}

      this.setState({ brightness: event.target.value })} />

    Source

      localStorage.setItem('backgroundAPI', document.getElementById('backgroundAPI').value)} > @@ -247,16 +247,16 @@ export default class BackgroundSettings extends React.PureComponent {
      -

      {this.props.language.background.custom_url} this.resetItem('customBackground')}>{this.props.language.reset}

      +

      {this.props.language.custom_url} this.resetItem('customBackground')}>{this.props.language.reset}

      this.setState({ customBackground: e.target.value })}>
      -

      {this.props.language.background.custom_background} this.resetItem('customBackground')}>{this.props.language.reset}

      - +

      {this.props.language.custom_background} this.resetItem('customBackground')}>{this.props.language.reset}

      + this.fileUpload(e)} />
      -

      {this.props.language.background.custom_colour} this.resetItem('customBackgroundColour')}>{this.props.language.reset}

      +

      {this.props.language.custom_colour} this.resetItem('customBackgroundColour')}>{this.props.language.reset}

      {colourSettings}
    diff --git a/src/components/modals/settings/sections/Greeting.jsx b/src/components/modals/settings/sections/Greeting.jsx index fd58404b..c5d2c0ff 100644 --- a/src/components/modals/settings/sections/Greeting.jsx +++ b/src/components/modals/settings/sections/Greeting.jsx @@ -41,18 +41,18 @@ export default class GreetingSettings extends React.PureComponent { render() { return (
    -

    Greeting

    - Enabled - - +

    {this.props.language.title}

    + Enabled + +
      -

      {this.props.language.greeting.name} this.resetItem()}>{this.props.language.reset}

      +

      {this.props.language.name} this.resetItem()}>Reset

      this.setState({ greetingName: e.target.value })}>

    Birthday

    - +
      -

      {this.props.language.greeting.birthday_date}

      +

      {this.props.language.birthday_date}

      this.changeDate(data)} value={this.state.birthday}/>
    diff --git a/src/components/modals/settings/sections/Search.jsx b/src/components/modals/settings/sections/Search.jsx index a8f418a2..874459fe 100644 --- a/src/components/modals/settings/sections/Search.jsx +++ b/src/components/modals/settings/sections/Search.jsx @@ -58,9 +58,9 @@ export default class SearchSettings extends React.PureComponent { return (

    Search

    - +
      - this.setSearchEngine(document.getElementById('searchEngine').value)} > @@ -71,7 +71,7 @@ export default class SearchSettings extends React.PureComponent {
      -

      {this.props.language.searchbar.custom} this.resetSearch()}>{this.props.language.reset}

      +

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

    diff --git a/src/components/modals/tabs/Settings.jsx b/src/components/modals/tabs/Settings.jsx index 6163f6a8..d889385f 100644 --- a/src/components/modals/tabs/Settings.jsx +++ b/src/components/modals/tabs/Settings.jsx @@ -23,16 +23,16 @@ export default function Settings (props) {
- +
- +
- +
- +
diff --git a/src/components/modals/tabs/backend/Tabs.jsx b/src/components/modals/tabs/backend/Tabs.jsx index 0fbb2794..97f0aea3 100644 --- a/src/components/modals/tabs/backend/Tabs.jsx +++ b/src/components/modals/tabs/backend/Tabs.jsx @@ -1,6 +1,7 @@ import React from 'react'; import Tab from './Tab'; +import ErrorBoundary from '../../../ErrorBoundary'; export default class Tabs extends React.PureComponent { constructor(props) { @@ -43,10 +44,12 @@ export default class Tabs extends React.PureComponent { })}
+ {this.props.children.map((child) => { if (child.props.label !== this.state.currentTab) return undefined; return child.props.children; })} +
); diff --git a/src/scss/index.scss b/src/scss/index.scss index 4af012ad..bf44cf16 100644 --- a/src/scss/index.scss +++ b/src/scss/index.scss @@ -6,11 +6,11 @@ @import 'modules/marketplace'; @import 'modules/buttons'; @import 'modules/dropdown'; -@import 'modules/welcome'; @import 'modules/modals/main'; @import 'modules/modals/feedback'; @import 'modules/modals/update'; +@import 'modules/modals/welcome'; body { background: #2f3640; diff --git a/src/scss/modules/_buttons.scss b/src/scss/modules/_buttons.scss index 7d93b91b..34a528e1 100644 --- a/src/scss/modules/_buttons.scss +++ b/src/scss/modules/_buttons.scss @@ -17,6 +17,17 @@ box-shadow: none; } +.refresh { + @extend %settingsButton; + background-color: map-get($button-colours, 'confirm'); + border: 2px solid map-get($button-colours, 'confirm'); + + &:hover { + border: 2px solid map-get($button-colours, 'confirm'); + color: map-get($button-colours, 'confirm'); + } +} + .apply { @extend %settingsButton; margin-right: 20px; diff --git a/src/scss/modules/_settings.scss b/src/scss/modules/_settings.scss index d0e18133..b7631bc9 100644 --- a/src/scss/modules/_settings.scss +++ b/src/scss/modules/_settings.scss @@ -64,8 +64,7 @@ input { } h4, -.switch, -.expandIcons { +.switch { display: inline; font-size: 1.4em; font-weight: 100; @@ -80,40 +79,10 @@ h4, margin-bottom: 20px; } -.expandIcons { - font-size: 25px; - vertical-align: middle; -} - -h4, -.expandIcons { +h4 { cursor: pointer; } -.extraSettings { - border-left: 10px solid; - border-image-slice: 1; - border-width: 5px; - list-style: none; - border-image-source: linear-gradient(to bottom, #ffb032 0%, #dd3b67 100%); - - p { - margin: 0; - padding: 0; - } - - select { - margin-left: 20px; - } - - input[type=text], - input[type=range], - p, - button { - margin-top: 10px; - } -} - ul { padding-left: 5px; margin: 0; diff --git a/src/scss/modules/_welcome.scss b/src/scss/modules/modals/_welcome.scss similarity index 100% rename from src/scss/modules/_welcome.scss rename to src/scss/modules/modals/_welcome.scss