From dad43e969fe6217b809f53d20a0c1dba3843f743 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Sat, 10 Apr 2021 16:22:37 +0100 Subject: [PATCH] fix: bug fixes Co-authored-by: Alex Sparkes --- .../modals/main/marketplace/sections/Added.jsx | 3 +-- src/components/modals/main/scss/index.scss | 9 +++------ .../modals/main/scss/settings/_buttons.scss | 6 +++--- src/components/widgets/Widgets.jsx | 2 +- .../widgets/background/Background.jsx | 18 +++++++++++++++--- src/components/widgets/quote/Quote.jsx | 8 ++++++-- src/components/widgets/quote/quote.scss | 3 +++ src/modules/default_settings.json | 4 ++++ 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/src/components/modals/main/marketplace/sections/Added.jsx b/src/components/modals/main/marketplace/sections/Added.jsx index 6eb7e7ba..253b21b0 100644 --- a/src/components/modals/main/marketplace/sections/Added.jsx +++ b/src/components/modals/main/marketplace/sections/Added.jsx @@ -107,8 +107,7 @@ export default class Added extends React.PureComponent {

Empty

-

Nothing here (yet)

- +

No addons are installed

); diff --git a/src/components/modals/main/scss/index.scss b/src/components/modals/main/scss/index.scss index 5a8f16e6..4f90d50b 100644 --- a/src/components/modals/main/scss/index.scss +++ b/src/components/modals/main/scss/index.scss @@ -115,11 +115,13 @@ ul.sidebar { left: 0; margin: 0; padding-left: 0; - height: 100vh; + height: 20%; background: var(--sidebar); border-radius: 12px 0 0 12px; text-align: left; font-size: 24px; + padding-bottom: 100%; + margin-bottom: -100%; h1 { text-align: center; @@ -163,11 +165,6 @@ li { background: var(--tab-active); } -@media only screen and (max-height: 898px) { - ul.sidebar { - height: auto; - } -} @media only screen and (max-width: 1200px) { li.tab-list-item { diff --git a/src/components/modals/main/scss/settings/_buttons.scss b/src/components/modals/main/scss/settings/_buttons.scss index e4ac4d35..63e4b34c 100644 --- a/src/components/modals/main/scss/settings/_buttons.scss +++ b/src/components/modals/main/scss/settings/_buttons.scss @@ -68,9 +68,9 @@ .uploadbg, .import { @extend %settingsButton; - background-color: map-get($button-colours, 'other'); - border: 2px solid map-get($button-colours, 'other'); - color: map-get($theme-colours, 'main'); + background-color: map-get($modal, 'sidebar'); + border: none; + color: map-get($theme-colours, 'secondary'); &:hover { color: map-get($button-colours, 'other'); diff --git a/src/components/widgets/Widgets.jsx b/src/components/widgets/Widgets.jsx index 0cfbf869..0396205e 100644 --- a/src/components/widgets/Widgets.jsx +++ b/src/components/widgets/Widgets.jsx @@ -86,7 +86,7 @@ export default class Widgets extends React.PureComponent {
{this.enabled('searchBar') ? : null} {elements} - {this.enabled('weatherEnabled') ? : null} + {this.enabled('weatherEnabled') && (localStorage.getItem('offlineMode') === 'false') ? : null}
); } diff --git a/src/components/widgets/background/Background.jsx b/src/components/widgets/background/Background.jsx index c4aa4f85..00bedd64 100644 --- a/src/components/widgets/background/Background.jsx +++ b/src/components/widgets/background/Background.jsx @@ -82,12 +82,14 @@ export default class Background extends React.PureComponent { // Main background getting function async getBackground() { - if (localStorage.getItem('offlineMode') === 'true') { - return this.offlineBackground(); - } + const offline = (localStorage.getItem('offlineMode') === 'true'); switch (localStorage.getItem('backgroundType')) { case 'api': + if (offline) { + return this.offlineBackground(); + } + // favourite button const favourited = JSON.parse(localStorage.getItem('favourite')); if (favourited) { @@ -155,6 +157,12 @@ export default class Background extends React.PureComponent { case 'custom': // custom user background const customBackground = localStorage.getItem('customBackground'); + + // allow users to use offline images + if (offline && !customBackground.startsWith('data:')) { + return this.offlineBackground(); + } + if (customBackground !== '') { // video background if (customBackground.endsWith('.mp4') || customBackground.endsWith('.webm') || customBackground.endsWith('.ogg')) { @@ -178,6 +186,10 @@ export default class Background extends React.PureComponent { break; case 'photo_pack': + if (offline) { + return this.offlineBackground(); + } + // photo pack const photoPack = JSON.parse(localStorage.getItem('photo_packs')); if (photoPack) { diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 4da921bd..401f7cbd 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -139,9 +139,13 @@ export default class Quote extends React.PureComponent { } componentDidMount() { - // todo: fix (localStorage.getItem('favouriteQuoteEnabled') === 'false') + let favouriteQuote = ''; + if (localStorage.getItem('favouriteQuoteEnabled') === 'true') { + favouriteQuote = localStorage.getItem('favouriteQuote') ? this.favourite()} /> : this.favourite()} />; + } + this.setState({ - favourited: localStorage.getItem('favouriteQuote') ? this.favourite()} /> : null, + favourited: favouriteQuote, copy: (localStorage.getItem('copyButton') === 'false') ? null : this.state.copy, tweet: (localStorage.getItem('tweetButton') === 'false') ? null : this.state.tweet }); diff --git a/src/components/widgets/quote/quote.scss b/src/components/widgets/quote/quote.scss index a4ac9202..b348e406 100644 --- a/src/components/widgets/quote/quote.scss +++ b/src/components/widgets/quote/quote.scss @@ -15,6 +15,9 @@ .quoteauthor { font-size: 0.9em; letter-spacing: 0.5px; + svg { + margin-left: 10px; + } } .copyButton { diff --git a/src/modules/default_settings.json b/src/modules/default_settings.json index a5f27c63..d1224e6a 100644 --- a/src/modules/default_settings.json +++ b/src/modules/default_settings.json @@ -162,5 +162,9 @@ { "name": "temperatureformat", "value": "celsius" + }, + { + "name": "authorLink", + "value": true } ]