diff --git a/src/components/modals/Modals.jsx b/src/components/modals/Modals.jsx index ff12c5f4..0c106036 100644 --- a/src/components/modals/Modals.jsx +++ b/src/components/modals/Modals.jsx @@ -27,6 +27,9 @@ export default class Modals extends React.PureComponent { welcomeModal: true }); } + + // hide refresh reminder once the user has refreshed the page + localStorage.setItem('showReminder', false); } closeWelcome() { diff --git a/src/components/modals/main/Main.jsx b/src/components/modals/main/Main.jsx index 6c6e86ee..f326ef30 100644 --- a/src/components/modals/main/Main.jsx +++ b/src/components/modals/main/Main.jsx @@ -8,10 +8,18 @@ const Settings = React.lazy(() => import('./tabs/Settings')); const Addons = React.lazy(() => import('./tabs/Addons')); const Marketplace = React.lazy(() => import('./tabs/Marketplace')); -const renderLoader = () => ( -
{window.language.modals.main.loading}
-
{window.language.modals.main.loading}
-
); +const renderLoader = () => ( + +
+
+
+

{window.language.modals.main.loading}

+
+
+
+
+
+); export default function MainModal(props) { const language = window.language.modals.main.navbar; diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index 3e48f8be..a66d480c 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -6,8 +6,6 @@ @import 'settings/dropdown'; @import 'settings/daypicker'; -@import 'settings/react-color-picker-gradient-picker-custom-styles.scss'; - @import 'marketplace/main'; .Modal { diff --git a/src/components/modals/main/scss/marketplace/_main.scss b/src/components/modals/main/scss/marketplace/_main.scss index 001f815b..0f5cb941 100644 --- a/src/components/modals/main/scss/marketplace/_main.scss +++ b/src/components/modals/main/scss/marketplace/_main.scss @@ -184,4 +184,4 @@ p.description { h1 { margin-top: -20px; } -} \ No newline at end of file +} diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index e83a950e..c0481a5e 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -129,12 +129,11 @@ input[type=color]::-moz-color-swatch { position: absolute; bottom: 20px; right: 20px; - padding: 20px; - color: #000; - background: #f0f0f0; + padding: 15px; + color: var(--modal-text); + background: var(--sidebar); max-width: 300px; border-radius: 0.7em; - display: none; h1 { font-size: 1em; diff --git a/src/components/modals/main/settings/Checkbox.jsx b/src/components/modals/main/settings/Checkbox.jsx index 3f491e70..07086a0d 100644 --- a/src/components/modals/main/settings/Checkbox.jsx +++ b/src/components/modals/main/settings/Checkbox.jsx @@ -21,6 +21,13 @@ export default class Checkbox extends React.PureComponent { checked: (this.state.checked === true) ? false : true }); + if (this.props.element) { + if (!document.querySelector(this.props.element)) { + document.querySelector('.reminder-info').style.display = 'block'; + return localStorage.setItem('showReminder', true); + } + } + EventBus.dispatch('refresh', this.props.category); } diff --git a/src/components/modals/main/settings/Dropdown.jsx b/src/components/modals/main/settings/Dropdown.jsx index 0fa10115..f626b5c4 100644 --- a/src/components/modals/main/settings/Dropdown.jsx +++ b/src/components/modals/main/settings/Dropdown.jsx @@ -29,6 +29,13 @@ export default class Dropdown extends React.PureComponent { this.props.onChange(value); } + if (this.props.element) { + if (!document.querySelector(this.props.element)) { + document.querySelector('.reminder-info').style.display = 'block'; + return localStorage.setItem('showReminder', true); + } + } + EventBus.dispatch('refresh', this.props.category); } diff --git a/src/components/modals/main/settings/Radio.jsx b/src/components/modals/main/settings/Radio.jsx index 5d79aa39..3030b9e0 100644 --- a/src/components/modals/main/settings/Radio.jsx +++ b/src/components/modals/main/settings/Radio.jsx @@ -25,6 +25,13 @@ export default class Radio extends React.PureComponent { value: value }); + if (this.props.element) { + if (!document.querySelector(this.props.element)) { + document.querySelector('.reminder-info').style.display = 'block'; + return localStorage.setItem('showReminder', true); + } + } + EventBus.dispatch('refresh', this.props.category); } diff --git a/src/components/modals/main/settings/Switch.jsx b/src/components/modals/main/settings/Switch.jsx index 5c13c97f..290c41c5 100644 --- a/src/components/modals/main/settings/Switch.jsx +++ b/src/components/modals/main/settings/Switch.jsx @@ -21,6 +21,13 @@ export default class Switch extends React.PureComponent { checked: (this.state.checked === true) ? false : true }); + if (this.props.element) { + if (!document.querySelector(this.props.element)) { + document.querySelector('.reminder-info').style.display = 'block'; + return localStorage.setItem('showReminder', true); + } + } + EventBus.dispatch('refresh', this.props.category); } diff --git a/src/components/modals/main/settings/Text.jsx b/src/components/modals/main/settings/Text.jsx index 7140922a..2566bd5b 100644 --- a/src/components/modals/main/settings/Text.jsx +++ b/src/components/modals/main/settings/Text.jsx @@ -26,6 +26,13 @@ export default class Text extends React.PureComponent { value: value }); + if (this.props.element) { + if (!document.querySelector(this.props.element)) { + document.querySelector('.reminder-info').style.display = 'block'; + return localStorage.setItem('showReminder', true); + } + } + EventBus.dispatch('refresh', this.props.category); } diff --git a/src/components/modals/main/settings/sections/Advanced.jsx b/src/components/modals/main/settings/sections/Advanced.jsx index f0dd42fa..0c865eef 100644 --- a/src/components/modals/main/settings/sections/Advanced.jsx +++ b/src/components/modals/main/settings/sections/Advanced.jsx @@ -44,13 +44,13 @@ export default class AdvancedSettings extends React.PureComponent { this.settingsImport(e)}/>

{advanced.customisation}

- - + +

{this.language.sections.experimental.title}

{advanced.experimental_warning}

- + this.setState({ resetModal: false })} isOpen={this.state.resetModal} className={'Modal resetmodal'} overlayClassName={'Overlay resetoverlay'} ariaHideApp={false}> this.setState({ resetModal: false })} /> diff --git a/src/components/modals/main/settings/sections/Appearance.jsx b/src/components/modals/main/settings/sections/Appearance.jsx index f131b546..ea701f26 100644 --- a/src/components/modals/main/settings/sections/Appearance.jsx +++ b/src/components/modals/main/settings/sections/Appearance.jsx @@ -32,14 +32,14 @@ export default function AppearanceSettings() {

{appearance.navbar.title}

- - + +

{appearance.font.title}

- +
- - + + {/* names are taken from https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight */} @@ -51,7 +51,7 @@ export default function AppearanceSettings() {

- + diff --git a/src/components/modals/main/settings/sections/Experimental.jsx b/src/components/modals/main/settings/sections/Experimental.jsx index 819b0093..87bb8fc1 100644 --- a/src/components/modals/main/settings/sections/Experimental.jsx +++ b/src/components/modals/main/settings/sections/Experimental.jsx @@ -11,10 +11,10 @@ export default function ExperimentalSettings() { <>

{experimental.title}

{experimental.warning}

- +

{experimental.developer}

- - + + {/* diff --git a/src/components/modals/main/settings/sections/Greeting.jsx b/src/components/modals/main/settings/sections/Greeting.jsx index 96117263..2f46abca 100644 --- a/src/components/modals/main/settings/sections/Greeting.jsx +++ b/src/components/modals/main/settings/sections/Greeting.jsx @@ -1,7 +1,5 @@ import React from 'react'; -import EventBus from '../../../../../modules/helpers/eventbus'; - import Checkbox from '../Checkbox'; import Switch from '../Switch'; import Text from '../Text'; @@ -25,7 +23,8 @@ export default class GreetingSettings extends React.PureComponent { birthday: data }); - EventBus.dispatch('refresh', 'greeting'); + document.querySelector('.reminder-info').style.display = 'block'; + localStorage.setItem('showReminder', true); } render() { @@ -34,14 +33,14 @@ export default class GreetingSettings extends React.PureComponent { return ( <>

{greeting.title}

- - - - + + + +

{greeting.birthday}

- - + +

{greeting.birthday_date}

diff --git a/src/components/modals/main/settings/sections/Language.jsx b/src/components/modals/main/settings/sections/Language.jsx index 3eb208f7..470702b1 100644 --- a/src/components/modals/main/settings/sections/Language.jsx +++ b/src/components/modals/main/settings/sections/Language.jsx @@ -11,7 +11,7 @@ export default function LanguageSettings() { return ( <>

{language.title}

- +

{language.quote}

diff --git a/src/components/modals/main/settings/sections/QuickLinks.jsx b/src/components/modals/main/settings/sections/QuickLinks.jsx index 5bf4fd29..3850ed46 100644 --- a/src/components/modals/main/settings/sections/QuickLinks.jsx +++ b/src/components/modals/main/settings/sections/QuickLinks.jsx @@ -9,7 +9,7 @@ export default function QuickLinks() { return ( <>

{language.title}

- + diff --git a/src/components/modals/main/settings/sections/Quote.jsx b/src/components/modals/main/settings/sections/Quote.jsx index 937edd7d..e2ea53aa 100644 --- a/src/components/modals/main/settings/sections/Quote.jsx +++ b/src/components/modals/main/settings/sections/Quote.jsx @@ -10,10 +10,10 @@ export default function QuoteSettings() { return ( <>

{quote.title}

- - - - + + + +

{quote.buttons.title}

diff --git a/src/components/modals/main/settings/sections/Time.jsx b/src/components/modals/main/settings/sections/Time.jsx index f813207e..578b57b4 100644 --- a/src/components/modals/main/settings/sections/Time.jsx +++ b/src/components/modals/main/settings/sections/Time.jsx @@ -94,7 +94,7 @@ export default class TimeSettings extends React.PureComponent { return ( <>

{time.title}

- + this.setState({ timeType: value })} category='clock'> diff --git a/src/components/modals/main/settings/sections/background/Colour.jsx b/src/components/modals/main/settings/sections/background/Colour.jsx index ebcbd7a0..46acfb1b 100644 --- a/src/components/modals/main/settings/sections/background/Colour.jsx +++ b/src/components/modals/main/settings/sections/background/Colour.jsx @@ -8,6 +8,7 @@ import rgbToHex from '../../../../../../modules/helpers/background/rgbToHex'; import { toast } from 'react-toastify'; import 'react-color-gradient-picker/dist/index.css'; +import '../../../scss/settings/react-color-picker-gradient-picker-custom-styles.scss'; export default class ColourSettings extends React.PureComponent { DefaultGradientSettings = { 'angle': '180', 'gradient': [{ 'colour': '#ffb032', 'stop': 0 }], 'type': 'linear' }; diff --git a/src/components/modals/main/tabs/Settings.jsx b/src/components/modals/main/tabs/Settings.jsx index a1eb0bf3..d108e9ed 100644 --- a/src/components/modals/main/tabs/Settings.jsx +++ b/src/components/modals/main/tabs/Settings.jsx @@ -18,29 +18,35 @@ import Weather from '../settings/sections/Weather'; import Tabs from './backend/Tabs'; export default function Settings() { - const settings = window.language.modals.main.settings.sections; + const { reminder, sections } = window.language.modals.main.settings; + + let display = 'none'; + if (localStorage.getItem('showReminder') === 'true') { + display = 'block'; + } return ( <> -
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-

IMPORTANT INFO

-

In order for changes to take place, the page must be refreshed.

+
+

{reminder.title}

+

{reminder.message}

+
); diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 45856d1f..fa84d472 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -55,6 +55,10 @@ }, "settings": { "enabled": "Enabled", + "reminder": { + "title": "NOTICE", + "message": "In order for all of the changes to take place, the page must be refreshed." + }, "sections": { "time": { "title": "Time", @@ -298,10 +302,6 @@ "last_updated": "Last Updated", "version": "Version", "author": "Authour", - "notice": { - "title": "Notice", - "description": "In order for the change to take place, the page must be refreshed." - }, "buttons": { "addtomue": "Add To Mue", "remove": "Remove"