From 2670c917b7edaba0d321d950428aed06fec6427f Mon Sep 17 00:00:00 2001 From: David Ralph Date: Thu, 8 Apr 2021 19:52:17 +0100 Subject: [PATCH] fix: font settings and quote widget --- README.md | 6 +++--- babel.config.js | 2 +- src/components/modals/main/scss/index.scss | 1 - src/components/modals/main/scss/settings/_main.scss | 1 - src/components/modals/main/settings/Radio.jsx | 2 +- src/components/modals/main/settings/Text.jsx | 2 +- src/components/modals/main/settings/sections/About.jsx | 2 +- .../main/settings/sections/background/Background.jsx | 2 +- src/components/widgets/Widgets.jsx | 4 ++-- src/components/widgets/background/Favourite.jsx | 2 +- src/components/widgets/background/Maximise.jsx | 8 +++++--- src/components/widgets/background/PhotoInformation.jsx | 4 ++-- src/components/widgets/navbar/Notes.jsx | 2 +- src/components/widgets/quote/Quote.jsx | 2 +- src/components/widgets/search/Search.jsx | 4 +++- src/components/widgets/time/Clock.jsx | 2 +- src/modules/helpers/settings.js | 4 ++-- 17 files changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index c3a76501..b9f0e5b1 100644 --- a/README.md +++ b/README.md @@ -73,16 +73,16 @@ Please note that we have dropped support for Opera as of Mue 5.0 [GitHub Releases](https://github.com/mue/mue/releases) ## Development -#### Requirements +### Requirements * [Git](https://git-scm.com/) * [Node.JS](https://nodejs.org/) * A suitable browser -#### Starting +### Starting 1. Clone the repository using `git clone https://github.com/mue/mue.git` 2. Run `yarn` or `npm i` to install all needed dependencies 3. Run `yarn start` or `npm start` to start testing 4. Code your heart out! (See the sections below for how to build the extension) -#### Building +### Building
Chrome/Edge (Chromium) (Click to expand)
    diff --git a/babel.config.js b/babel.config.js index b7c4585f..18ee434b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,4 +3,4 @@ module.exports = { plugins: ['@babel/plugin-proposal-class-properties', ['@babel/transform-runtime', { 'regenerator': true }]] -} +}; diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index b3c801f0..9c68e871 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -126,7 +126,6 @@ ul.sidebar { text-align: center; } - svg { vertical-align: middle; font-size: 35px; diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index 4c12025d..4e083c5b 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -33,7 +33,6 @@ ul { border-radius: 12px; outline: none; background: var(--sidebar); - border-radius: 12px; box-shadow: 0 0 100px rgba(0, 0, 0, 0.3); &::-webkit-slider-thumb { diff --git a/src/components/modals/main/settings/Radio.jsx b/src/components/modals/main/settings/Radio.jsx index 87393273..36fda249 100644 --- a/src/components/modals/main/settings/Radio.jsx +++ b/src/components/modals/main/settings/Radio.jsx @@ -29,7 +29,7 @@ export default class Radio extends React.PureComponent { {this.props.title} - {this.props.options.map(option => ( + {this.props.options.map((option) => ( } label={option.name} key={option.name} /> ))} diff --git a/src/components/modals/main/settings/Text.jsx b/src/components/modals/main/settings/Text.jsx index 89a88154..2a33532d 100644 --- a/src/components/modals/main/settings/Text.jsx +++ b/src/components/modals/main/settings/Text.jsx @@ -12,7 +12,7 @@ export default class Text extends React.PureComponent { } handleChange = (e) => { - const { value } = e.target; + let { value } = e.target; // Alex wanted font to work with montserrat and Montserrat, so I made it work if (this.props.upperCaseFirst === true) { diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/components/modals/main/settings/sections/About.jsx index 49df30ab..c775e632 100644 --- a/src/components/modals/main/settings/sections/About.jsx +++ b/src/components/modals/main/settings/sections/About.jsx @@ -17,7 +17,7 @@ export default class About extends React.PureComponent { photographers: [], update: window.language.modals.main.settings.sections.about.version.checking_update, loading: window.language.modals.main.loading - } + }; this.language = window.language.modals.main.settings.sections.about; } diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index abd992c0..5c3fbf75 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -58,7 +58,7 @@ export default class BackgroundSettings extends React.PureComponent { 'name': 'Unsplash', 'value': 'unsplash' } - ] + ]; const APISettings = ( <> diff --git a/src/components/widgets/Widgets.jsx b/src/components/widgets/Widgets.jsx index b399bcd0..dcf99504 100644 --- a/src/components/widgets/Widgets.jsx +++ b/src/components/widgets/Widgets.jsx @@ -19,7 +19,7 @@ export default class Widgets extends React.PureComponent { quote: this.enabled('quote') ? : null, date: this.enabled('date') ? : null, quicklinks: this.enabled('quicklinksenabled') ? : null - } + }; } enabled(key) { @@ -75,7 +75,7 @@ export default class Widgets extends React.PureComponent { const order = JSON.parse(localStorage.getItem('order')); if (order) { - order.forEach(element => { + order.forEach((element) => { elements.push({this.widgets[element]}); }); } else { diff --git a/src/components/widgets/background/Favourite.jsx b/src/components/widgets/background/Favourite.jsx index b1204b7d..226b825a 100644 --- a/src/components/widgets/background/Favourite.jsx +++ b/src/components/widgets/background/Favourite.jsx @@ -36,6 +36,6 @@ export default class Favourite extends React.PureComponent { return null; } - return {this.state.favourited} + return {this.state.favourited}; } } diff --git a/src/components/widgets/background/Maximise.jsx b/src/components/widgets/background/Maximise.jsx index 2cba2c12..8f4e58eb 100644 --- a/src/components/widgets/background/Maximise.jsx +++ b/src/components/widgets/background/Maximise.jsx @@ -51,8 +51,10 @@ export default class View extends React.PureComponent { return null; } - return - this.viewStuff()} className='topicons' /> - + return ( + + this.viewStuff()} className='topicons' /> + + ); } } diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index 59b11e2b..5994719f 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -11,7 +11,7 @@ const toDataURL = async (url) => { const response = await fetch(url); const blob = await response.blob(); return URL.createObjectURL(blob); -} +}; const downloadImage = async (info) => { const link = document.createElement('a'); @@ -21,7 +21,7 @@ const downloadImage = async (info) => { document.body.appendChild(link); link.click(); document.body.removeChild(link); -} +}; export default function PhotoInformation(props) { const language = window.language.widgets.background; diff --git a/src/components/widgets/navbar/Notes.jsx b/src/components/widgets/navbar/Notes.jsx index 61444998..2ae3bd5e 100644 --- a/src/components/widgets/navbar/Notes.jsx +++ b/src/components/widgets/navbar/Notes.jsx @@ -12,7 +12,7 @@ export default class Notes extends React.PureComponent { this.state = { notes: localStorage.getItem('notes') || '' }; - this.language = window.language.widgets.navbar.notes + this.language = window.language.widgets.navbar.notes; } setNotes = (e) => { diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index b4e49130..4da921bd 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -101,7 +101,7 @@ export default class Quote extends React.PureComponent { let authorlink = `https://${this.languagecode.split('_')[0]}.wikipedia.org/wiki/${data.author.split(' ').join('_')}`; if (localStorage.getItem('authorLink') === 'false') { - authorLink = null; + authorlink = null; } this.setState({ diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx index 452d80b8..45fa383c 100644 --- a/src/components/widgets/search/Search.jsx +++ b/src/components/widgets/search/Search.jsx @@ -50,7 +50,9 @@ export default class Search extends React.PureComponent { if (info !== undefined) { url = info.url; - if (info.query) query = info.query; + if (info.query) { + query = info.query; + } } if (setting === 'custom') { diff --git a/src/components/widgets/time/Clock.jsx b/src/components/widgets/time/Clock.jsx index 98081f45..208bcbaa 100644 --- a/src/components/widgets/time/Clock.jsx +++ b/src/components/widgets/time/Clock.jsx @@ -93,7 +93,7 @@ export default class Clock extends React.PureComponent { const checkValue = (setting) => { return (localStorage.getItem(setting) === 'true'); - } + }; if (localStorage.getItem('timeType') === 'analogue') { clockHTML = ( diff --git a/src/modules/helpers/settings.js b/src/modules/helpers/settings.js index bb2ae62d..2969d84e 100644 --- a/src/modules/helpers/settings.js +++ b/src/modules/helpers/settings.js @@ -91,12 +91,12 @@ export default class SettingsFunctions { url = `@import url('https://fonts.googleapis.com/css2?family=${font}&display=swap');`; } - const fontWeight = localStorage.getItem('fontWeight'); + const fontWeight = localStorage.getItem('fontweight'); if (fontWeight) { fontweight = `font-weight: ${fontWeight};`; } - const fontStyle = localStorage.getItem('fontStyle'); + const fontStyle = localStorage.getItem('fontstyle'); if (fontStyle) { fontstyle = `font-style: ${fontStyle};`; }