diff --git a/src/components/modals/settings/sections/Advanced.jsx b/src/components/modals/settings/sections/Advanced.jsx index 4cdfd3ba..5fb3d55f 100644 --- a/src/components/modals/settings/sections/Advanced.jsx +++ b/src/components/modals/settings/sections/Advanced.jsx @@ -40,11 +40,13 @@ export default class AdvancedSettings extends React.PureComponent {

{advanced.title}

+

{advanced.data}

this.settingsImport(e)} /> +

{advanced.customisation}

    {advanced.custom_css} this.resetItem('customcss')}>{this.props.language.buttons.reset}

    diff --git a/src/components/modals/settings/sections/Appearance.jsx b/src/components/modals/settings/sections/Appearance.jsx index 7e1ad537..22010f21 100644 --- a/src/components/modals/settings/sections/Appearance.jsx +++ b/src/components/modals/settings/sections/Appearance.jsx @@ -10,7 +10,7 @@ export default class AppearanceSettings extends React.PureComponent { this.state = { zoom: localStorage.getItem('zoom'), toast_duration: localStorage.getItem('toastDisplayTime'), - font: localStorage.getItem('font') + font: localStorage.getItem('font') || '' }; } @@ -58,15 +58,18 @@ export default class AppearanceSettings extends React.PureComponent {

    {appearance.title}

    +

    {appearance.navbar.title}

    +

    {appearance.font.title}

      {appearance.font.custom} this.resetItem('font')}>{this.props.language.buttons.reset}

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

    {appearance.accessibility.title}

      diff --git a/src/components/modals/settings/sections/Background.jsx b/src/components/modals/settings/sections/Background.jsx index 6c7d2d06..878a9518 100644 --- a/src/components/modals/settings/sections/Background.jsx +++ b/src/components/modals/settings/sections/Background.jsx @@ -14,7 +14,7 @@ import 'react-color-gradient-picker/dist/index.css'; import '../../../../scss/react-color-picker-gradient-picker-custom-styles.scss'; export default class BackgroundSettings extends React.PureComponent { - DefaultGradientSettings = { 'angle': '180', 'gradient': [{ 'colour': this.props.language.sections.background.disabled, 'stop': 0 }], 'type': 'linear' }; + DefaultGradientSettings = { 'angle': '180', 'gradient': [{ 'colour': this.props.language.sections.background.source.disabled, 'stop': 0 }], 'type': 'linear' }; GradientPickerInitalState = undefined; constructor(...args) { @@ -129,14 +129,14 @@ export default class BackgroundSettings extends React.PureComponent { } currentGradientSettings = () => { - if (typeof this.state.gradientSettings === 'object' && this.state.gradientSettings.gradient.every(g => g.colour !== this.props.language.sections.background.disabled)) { + if (typeof this.state.gradientSettings === 'object' && this.state.gradientSettings.gradient.every(g => g.colour !== this.props.language.sections.background.source.disabled)) { const clampNumber = (num, a, b) => Math.max(Math.min(num, Math.max(a, b)), Math.min(a, b)); return JSON.stringify({ ...this.state.gradientSettings, gradient: [...this.state.gradientSettings.gradient.map(g => { return { ...g, stop: clampNumber(+g.stop, 0, 100) } })].sort((a, b) => (a.stop > b.stop) ? 1 : -1) }); } - return this.props.language.sections.background.disabled; + return this.props.language.sections.background.source.disabled; } onColorPickerChange = (attrs, name) => { @@ -169,7 +169,7 @@ export default class BackgroundSettings extends React.PureComponent { localStorage.setItem('brightness', this.state.brightness); localStorage.setItem('customBackground', this.state.customBackground); - if (document.getElementById('customBackgroundHex').value !== this.props.language.sections.background.disabled) { + if (document.getElementById('customBackgroundHex').value !== this.props.language.sections.background.source.disabled) { localStorage.setItem('customBackgroundColour', document.getElementById('customBackgroundHex').value); } } @@ -209,8 +209,8 @@ export default class BackgroundSettings extends React.PureComponent { colourSettings = (
      {gradientInputs} - {this.state.gradientSettings.gradient[0].colour !== background.disabled && - !gradientHasMoreThanOneColour ? () : null + {this.state.gradientSettings.gradient[0].colour !== background.source.disabled && + !gradientHasMoreThanOneColour ? () : null }
      ); @@ -218,26 +218,26 @@ export default class BackgroundSettings extends React.PureComponent { return (
      -

      Background

      +

      {background.title}

      -

      Buttons

      +

      {background.buttons.title}

        - - + +
      -

      Effects

      +

      {background.effects.title}

        -

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

        +

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

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

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

        +

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

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

      Source

      +

      {background.source.title}

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

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

        +

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

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

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

        - +

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

        + this.fileUpload(e)} />
        -

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

        +

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

        {colourSettings}
      diff --git a/src/components/modals/settings/sections/Greeting.jsx b/src/components/modals/settings/sections/Greeting.jsx index 53c77b05..99935a2d 100644 --- a/src/components/modals/settings/sections/Greeting.jsx +++ b/src/components/modals/settings/sections/Greeting.jsx @@ -52,6 +52,7 @@ export default class GreetingSettings extends React.PureComponent {

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

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

    {greeting.birthday}

      diff --git a/src/components/modals/settings/sections/Quote.jsx b/src/components/modals/settings/sections/Quote.jsx index 3f6f493d..e68565af 100644 --- a/src/components/modals/settings/sections/Quote.jsx +++ b/src/components/modals/settings/sections/Quote.jsx @@ -8,7 +8,7 @@ export default class QuoteSettings extends React.PureComponent { constructor(...args) { super(...args); this.state = { - customQuote: localStorage.getItem('customQuote'), + customQuote: localStorage.getItem('customQuote') || '', customQuoteAuthor: localStorage.getItem('customQuoteAuthor') || 'Unknown' }; } @@ -51,17 +51,17 @@ export default class QuoteSettings extends React.PureComponent {
        -

        {quote.custom} this.resetItem('customQuote')}>{this.props.language.buttons.reset}

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

        {quote.custom} this.resetItem('customQuote')}>{this.props.language.buttons.reset}

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

        {quote.custom_author} this.resetItem('customQuoteAuthor')}>{this.props.language.buttons.reset}

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

        {quote.custom_author} this.resetItem('customQuoteAuthor')}>{this.props.language.buttons.reset}

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

      {quote.buttons}

      - - - +

      {quote.buttons.title}

      + + +
); } diff --git a/src/components/modals/settings/sections/Time.jsx b/src/components/modals/settings/sections/Time.jsx index 78ac8074..1005a7ea 100644 --- a/src/components/modals/settings/sections/Time.jsx +++ b/src/components/modals/settings/sections/Time.jsx @@ -28,7 +28,9 @@ export default class TimeSettings extends React.PureComponent { render() { const { time } = this.props.language.sections; - let digitalSettings = ( + let timeSettings; + + const digitalSettings = (

{time.digital.title}

@@ -38,7 +40,7 @@ export default class TimeSettings extends React.PureComponent {
); - let analogSettings = ( + const analogSettings = (

{time.analogue.title}

@@ -50,9 +52,9 @@ export default class TimeSettings extends React.PureComponent { ); switch (this.state.timeType) { - case 'digital': break; - case 'analogue': digitalSettings = analogSettings; break; - default: digitalSettings = null; break; + case 'digital': timeSettings = digitalSettings; break; + case 'analogue': timeSettings = analogSettings; break; + default: timeSettings = null; break; } return ( @@ -64,7 +66,9 @@ export default class TimeSettings extends React.PureComponent { - {digitalSettings} + + {timeSettings} +

{time.date.title}

diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx index 36e6172e..3b877dfc 100644 --- a/src/components/widgets/background/Background.jsx +++ b/src/components/widgets/background/Background.jsx @@ -194,6 +194,6 @@ export default class Background extends React.PureComponent { } render() { - return
; + return
; } } diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index 86d0ac31..0d98bfb6 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -15,13 +15,13 @@ export default function PhotoInformation(props) {

{props.language.information}


- + - + - + - +
diff --git a/src/components/widgets/greeting/Greeting.jsx b/src/components/widgets/greeting/Greeting.jsx index 571e5b8b..3cfaa081 100644 --- a/src/components/widgets/greeting/Greeting.jsx +++ b/src/components/widgets/greeting/Greeting.jsx @@ -72,7 +72,7 @@ export default class Greeting extends React.PureComponent { // Birthday const birth = new Date(localStorage.getItem('birthday')); if (localStorage.getItem('birthdayenabled') === 'true' && birth.getDate() === now.getDate() && birth.getMonth() === now.getMonth()) { - message = 'Happy Birthday'; + message = this.props.language.birthday; } // Set the state to the greeting string diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/components/widgets/navbar/Navbar.jsx index dc253a11..dc070404 100644 --- a/src/components/widgets/navbar/Navbar.jsx +++ b/src/components/widgets/navbar/Navbar.jsx @@ -14,53 +14,33 @@ import './scss/index.scss'; const Notes = React.lazy(() => import('./Notes')); const renderLoader = () =>
; -export default class Navbar extends React.PureComponent { - render() { - // toggle refresh button - let refreshHTML = ( - - window.location.reload()} /> - - ); +export default function Navbar(props) { + return ( +
+ {(localStorage.getItem('notesEnabled') === 'true') ? +
+ + + + +
+ :null} - if (localStorage.getItem('refresh') === 'false') { - refreshHTML = null; - } - - // toggle feedback button - let feedbackHTML = ( - - this.props.openModal('feedbackModal')} /> - - ); - - if (Constants.BETA_VERSION === false) { - feedbackHTML = null; - } - - // toggle notes - let notesHTML = ( -
- - - - -
- ); - - if (localStorage.getItem('notesEnabled') === 'false') { - notesHTML = null; - } - - return ( -
- {notesHTML} - {feedbackHTML} - {refreshHTML} - - this.props.openModal('mainModal')} /> + {(Constants.BETA_VERSION === true) ? + + props.openModal('feedbackModal')}/> -
- ); - } + :null} + + {(localStorage.getItem('refresh') === 'true') ? + + window.location.reload()}/> + + :null} + + + props.openModal('mainModal')}/> + +
+ ); } diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 30fde99d..261beb4f 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -153,7 +153,8 @@ export default class Quote extends React.PureComponent {

{`${this.state.quote}`}

- {this.state.author} {this.state.copy} {this.state.tweet} {this.state.favourited} + {this.state.author} + {this.state.copy} {this.state.tweet} {this.state.favourited}

); diff --git a/src/modules/constants.js b/src/modules/constants.js index 1b282398..dd970f6a 100644 --- a/src/modules/constants.js +++ b/src/modules/constants.js @@ -2,7 +2,7 @@ export const API_URL = 'https://api.muetab.com'; export const UNSPLASH_URL = 'https://unsplash.muetab.com'; export const MARKETPLACE_URL = 'https://marketplace.muetab.com'; export const WEBSITE_URL = 'https://muetab.com'; -export const SPONSORS_URL = 'https://muesponsors.vercel.app'; // todo: make sponsors.muetab.com work +export const SPONSORS_URL = 'https://sponsors.muetab.com'; export const OFFLINE_IMAGES = 20; export const BETA_VERSION = false; export const VERSION = '5.0.0'; diff --git a/src/modules/helpers/settings.js b/src/modules/helpers/settings.js index 93f0ed31..b1b8357b 100644 --- a/src/modules/helpers/settings.js +++ b/src/modules/helpers/settings.js @@ -110,5 +110,24 @@ export default class SettingsFunctions { if (zoom !== 100) { document.body.style.zoom = zoom + '%'; } + + // easter egg + console.log(` + █████████████████████████████████████████████████████████████ + ██ ██ + ██ ███ ███ ██ ██ ███████ ██ + ██ ████ ████ ██ ██ ██ ██ + ██ ██ ████ ██ ██ ██ █████ ██ + ██ ██ ██ ██ ██ ██ ██ ██ + ██ ██ ██ ██████ ███████ ██ + ██ ██ + ██ ██ + ██ Copyright 2018-2021 Mue ██ + ██ GitHub: https://github.com/mue/mue ██ + ██ ██ + ██ Thank you for using! ██ + ██ Feedback: hello@muetab.com ██ + █████████████████████████████████████████████████████████████ +`); } } diff --git a/src/scss/modules/_dropdown.scss b/src/scss/modules/_dropdown.scss index 7cb1ca7c..80e06da8 100644 --- a/src/scss/modules/_dropdown.scss +++ b/src/scss/modules/_dropdown.scss @@ -26,11 +26,15 @@ } } -.react-date-picker__wrapper{ - padding: 0.5rem 1rem !important; - box-sizing: border-box !important; - border-image-slice: 1 !important; - border-image-source: linear-gradient( 90deg, #ffb032 0%, #dd3b67 100%) !important; - background: transparent !important; - color: #fff !important; +.react-date-picker__wrapper { + padding: 0.5rem 1rem !important; + box-sizing: border-box !important; + border-image-slice: 1 !important; + border-image-source: linear-gradient(90deg, #ffb032 0%, #dd3b67 100%) !important; + background: transparent !important; + color: #fff !important; } + +.react-date-picker__clear-button, .react-calendar__navigation__prev2-button, .react-calendar__navigation__next2-button { + display: none !important; +} \ No newline at end of file diff --git a/src/translations/en-GB.json b/src/translations/en-GB.json index fb2db61e..44cee06f 100644 --- a/src/translations/en-GB.json +++ b/src/translations/en-GB.json @@ -6,7 +6,8 @@ "evening": "Good Evening", "christmas": "Merry Christmas", "newyear": "Happy New Year", - "halloween": "Happy Halloween" + "halloween": "Happy Halloween", + "birthday": "Happy Birthday" }, "background": { "credit": "Photo by", @@ -71,13 +72,15 @@ }, "quote": { "title": "Quote", - "buttons": "Buttons", - "copy": "Copy", - "tweet": "Tweet", - "favourite": "Favourite", "author_link": "Authour Link", "custom": "Custom Quote", - "custom_author": "Custom Authour" + "custom_author": "Custom Authour", + "buttons": { + "title": "Buttons", + "copy": "Copy", + "tweet": "Tweet", + "favourite": "Favourite" + } }, "greeting": { "title": "Greeting", @@ -89,17 +92,26 @@ }, "background": { "title": "Background", - "api": "Background API", - "blur": "Adjust Blur", - "brightness": "Adjust Brightness", - "custom_url": "Custom Background URL", - "custom_background": "Custom Background", - "custom_colour": "Custom Background Colour", - "upload": "Upload", - "add_colour": "Add colour", - "favourite": "Favourite", - "view": "View", - "disabled": "Disabled" + "buttons": { + "title": "Buttons", + "view": "View", + "favourite": "Favourite" + }, + "effects": { + "title": "Effects", + "blur": "Adjust Blur", + "brightness": "Adjust Brightness" + }, + "source": { + "title": "Source", + "api": "Background API", + "custom_url": "Custom Background URL", + "custom_background": "Custom Background", + "custom_colour": "Custom Background Colour", + "upload": "Upload", + "add_colour": "Add colour", + "disabled": "Disabled" + } }, "search": { "title": "Search",