From 2563850fcc2cf82bd454884586554bb3960428a8 Mon Sep 17 00:00:00 2001 From: David Ralph Date: Wed, 31 Aug 2022 13:31:49 +0100 Subject: [PATCH] fix: cleanup code and fix weather etc Co-authored-by: Alex Sparkes --- package.json | 1 - src/components/modals/Modals.jsx | 2 - .../modals/main/scss/settings/_main.scss | 8 - .../modals/main/settings/Checkbox.jsx | 28 +- .../modals/main/settings/KeybindInput.jsx | 50 ---- .../modals/main/settings/Switch.jsx | 26 +- .../main/settings/sections/Keybinds.jsx | 255 ------------------ .../main/settings/sections/Overview.jsx | 2 +- .../modals/main/settings/sections/Weather.jsx | 1 + src/components/modals/main/tabs/Settings.jsx | 2 - .../modals/main/tabs/backend/Tab.jsx | 2 - .../widgets/background/Favourite.jsx | 8 +- .../widgets/background/Maximise.jsx | 2 - .../widgets/background/PhotoInformation.jsx | 1 - src/components/widgets/message/Message.jsx | 3 + src/components/widgets/navbar/Navbar.jsx | 9 +- src/components/widgets/navbar/Notes.jsx | 31 +-- src/components/widgets/navbar/Todo.jsx | 14 +- .../widgets/quicklinks/QuickLinks.jsx | 2 - src/components/widgets/quote/Quote.jsx | 92 +++---- src/components/widgets/search/Search.jsx | 2 - src/components/widgets/time/Clock.jsx | 42 ++- src/components/widgets/weather/Weather.jsx | 75 +++--- src/index.jsx | 4 - src/modules/variables.js | 1 - src/translations/de_DE.json | 23 -- src/translations/en_GB.json | 23 -- src/translations/en_US.json | 23 -- src/translations/es.json | 23 -- src/translations/fr.json | 23 -- src/translations/id_ID.json | 23 -- src/translations/nl.json | 23 -- src/translations/no.json | 23 -- src/translations/ru.json | 23 -- src/translations/tr_TR.json | 23 -- src/translations/zh_CN.json | 23 -- 36 files changed, 143 insertions(+), 773 deletions(-) delete mode 100644 src/components/modals/main/settings/KeybindInput.jsx delete mode 100644 src/components/modals/main/settings/sections/Keybinds.jsx diff --git a/package.json b/package.json index 0b7713b3..fd53bdb4 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,6 @@ "react-clock": "3.1.0", "react-color-gradient-picker": "0.1.2", "react-dom": "^18.2.0", - "react-hot-keys": "2.7.2", "react-icons": "^4.4.0", "react-modal": "3.15.1", "react-sortable-hoc": "2.0.0", diff --git a/src/components/modals/Modals.jsx b/src/components/modals/Modals.jsx index 462d2818..2cc5dfb8 100644 --- a/src/components/modals/Modals.jsx +++ b/src/components/modals/Modals.jsx @@ -1,7 +1,6 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import Modal from 'react-modal'; -//import Hotkeys from 'react-hot-keys'; import Main from './main/Main'; import Navbar from '../widgets/navbar/Navbar'; @@ -104,7 +103,6 @@ export default class Modals extends PureComponent { this.closeWelcome()} modalSkip={() => this.previewWelcome()} /> {this.state.preview ? window.location.reload()} /> : null} - {/*variables.keybinds.toggleModal && variables.keybinds.toggleModal !== '' ? this.toggleModal('mainModal', (this.state.mainModal === true ? false : true))}/> : null*/} ); } diff --git a/src/components/modals/main/scss/settings/_main.scss b/src/components/modals/main/scss/settings/_main.scss index de119462..db15b463 100644 --- a/src/components/modals/main/scss/settings/_main.scss +++ b/src/components/modals/main/scss/settings/_main.scss @@ -82,14 +82,6 @@ h4 { cursor: pointer; } -.keybind-table { - text-align: left; - - th { - padding-right: 10px; - } -} - .photosEmpty { height: 400px; display: grid; diff --git a/src/components/modals/main/settings/Checkbox.jsx b/src/components/modals/main/settings/Checkbox.jsx index efe7bfec..9dda856b 100644 --- a/src/components/modals/main/settings/Checkbox.jsx +++ b/src/components/modals/main/settings/Checkbox.jsx @@ -41,21 +41,19 @@ export default class Checkbox extends PureComponent { render() { return ( - <> - - } - label={this.props.text} - /> - + + } + label={this.props.text} + /> ); } } diff --git a/src/components/modals/main/settings/KeybindInput.jsx b/src/components/modals/main/settings/KeybindInput.jsx deleted file mode 100644 index 2c0ea195..00000000 --- a/src/components/modals/main/settings/KeybindInput.jsx +++ /dev/null @@ -1,50 +0,0 @@ -import variables from 'modules/variables'; -import { MdCancel } from 'react-icons/md'; -import { TextField } from '@mui/material'; - -export default function KeybindInput(props) { - const value = props.state[props.setting]; - - const getButton = () => { - if (!value) { - return ( - - ); - } else if (value === variables.getMessage('modals.main.settings.sections.keybinds.recording')) { - return ( - - ); - } else { - return ( - - ); - } - }; - - return ( - <> - props.action('listen', props.setting)} - value={ - value || variables.getMessage('modals.main.settings.sections.keybinds.click_to_record') - } - readOnly - spellCheck={false} - varient="outlined" - InputLabelProps={{ shrink: true }} - /> - {getButton()} - - ); -} diff --git a/src/components/modals/main/settings/Switch.jsx b/src/components/modals/main/settings/Switch.jsx index 71044afe..80b72457 100644 --- a/src/components/modals/main/settings/Switch.jsx +++ b/src/components/modals/main/settings/Switch.jsx @@ -37,20 +37,18 @@ export default class Switch extends PureComponent { render() { return ( - <> - - } - label={this.props.header ? '' : this.props.text} - labelPlacement="start" - /> - + + } + label={this.props.header ? '' : this.props.text} + labelPlacement="start" + /> ); } } diff --git a/src/components/modals/main/settings/sections/Keybinds.jsx b/src/components/modals/main/settings/sections/Keybinds.jsx deleted file mode 100644 index 62dc746f..00000000 --- a/src/components/modals/main/settings/sections/Keybinds.jsx +++ /dev/null @@ -1,255 +0,0 @@ -import variables from 'modules/variables'; -import { PureComponent } from 'react'; - -import Header from '../Header'; -import KeybindInput from '../KeybindInput'; - -export default class KeybindSettings extends PureComponent { - constructor() { - super(); - this.state = { - keybinds: JSON.parse(localStorage.getItem('keybinds')) || {}, - cancelled: false, - }; - } - - showReminder() { - document.querySelector('.reminder-info').style.display = 'none'; - return localStorage.setItem('showReminder', false); - } - - listen(type) { - const currentKeybinds = this.state.keybinds; - currentKeybinds[type] = variables.getMessage( - 'modals.main.settings.sections.keybinds.recording', - ); - this.setState({ - keybinds: currentKeybinds, - cancelled: false, - }); - this.forceUpdate(); - - let keys = ''; - let previouskey = ''; - this.keydown = document.addEventListener('keydown', (event) => { - if (event.key === previouskey && this.state.cancelled === true) { - return; - } - - if (keys === '') { - keys = event.key; - } else { - keys = `${keys}+${event.key}`; - } - - previouskey = event.key; - }); - - this.keyup = document.addEventListener('keyup', () => { - if (this.state.cancelled === true) { - return; - } - - document.removeEventListener('keydown', this.keydown); - const keybinds = this.state.keybinds; - keybinds[type] = keys.split('+').slice(0, 4).join('+'); - localStorage.setItem('keybinds', JSON.stringify(keybinds)); - this.setState({ - keybinds: JSON.parse(localStorage.getItem('keybinds')) || {}, - }); - }); - - document.removeEventListener('keyup', this.keyup); - - this.showReminder(); - } - - cancel(type) { - document.removeEventListener('keydown', this.keydown); - document.removeEventListener('keyup', this.keyup); - - const currentKeybinds = this.state.keybinds; - delete currentKeybinds[type]; - - this.setState({ - keybinds: currentKeybinds, - cancelled: true, - }); - this.forceUpdate(); - } - - reset(type) { - const keybinds = this.state.keybinds; - keybinds[type] = ''; - localStorage.setItem('keybinds', JSON.stringify(keybinds)); - - this.setState({ - keybinds: JSON.parse(localStorage.getItem('keybinds')) || {}, - cancelled: true, - }); - - this.showReminder(); - } - - action(action, e) { - switch (action) { - case 'listen': - this.listen(e); - break; - case 'cancel': - this.cancel(e); - break; - case 'reset': - this.reset(e); - break; - default: - break; - } - } - - render() { - return ( - <> -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> - - this.action(type, e)} - /> -
- this.action(type, e)} - /> -
- - ); - } -} diff --git a/src/components/modals/main/settings/sections/Overview.jsx b/src/components/modals/main/settings/sections/Overview.jsx index 480da42c..0d6bfc64 100644 --- a/src/components/modals/main/settings/sections/Overview.jsx +++ b/src/components/modals/main/settings/sections/Overview.jsx @@ -114,7 +114,7 @@ export default class OrderSettings extends PureComponent { */}
- Preview + {variables.getMessage('modals.welcome.buttons.preview')}
{this.state.items.map((value, index) => { diff --git a/src/components/modals/main/settings/sections/Weather.jsx b/src/components/modals/main/settings/sections/Weather.jsx index a03ee0a0..1ff8bd5f 100644 --- a/src/components/modals/main/settings/sections/Weather.jsx +++ b/src/components/modals/main/settings/sections/Weather.jsx @@ -60,6 +60,7 @@ export default class TimeSettings extends PureComponent { render() { const weatherType = localStorage.getItem('weatherType'); + return ( <>
- {/*
*/}
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx index 77c90434..96eea0e0 100644 --- a/src/components/modals/main/tabs/backend/Tab.jsx +++ b/src/components/modals/main/tabs/backend/Tab.jsx @@ -18,7 +18,6 @@ import { MdTranslate as Language, MdOutlineSettings as Advanced, MdBugReport as Experimental, - //KeyboardAltOutlined as Keybinds, MdOutlineAssessment as Stats, MdOutlineNewReleases as Changelog, MdInfoOutline as About, @@ -99,7 +98,6 @@ function Tab({ label, currentTab, onClick, navbarTab }) { case variables.getMessage('modals.main.settings.sections.advanced.title'): icon = ; break; - //case variables.getMessage('modals.main.settings.sections.keybinds.title'): icon = ; break; case variables.getMessage('modals.main.settings.sections.stats.title'): icon = ; break; diff --git a/src/components/widgets/background/Favourite.jsx b/src/components/widgets/background/Favourite.jsx index 0cf80df3..8bf7778e 100644 --- a/src/components/widgets/background/Favourite.jsx +++ b/src/components/widgets/background/Favourite.jsx @@ -1,7 +1,6 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { MdStar, MdStarBorder } from 'react-icons/md'; -//import Hotkeys from 'react-hot-keys'; export default class Favourite extends PureComponent { buttons = { @@ -91,11 +90,6 @@ export default class Favourite extends PureComponent { return null; } - return ( - <> - {this.state.favourited} - {/*variables.keybinds.favouriteBackground && variables.keybinds.favouriteBackground !== '' ? this.favourite()} /> : null*/} - - ); + return this.state.favourited; } } diff --git a/src/components/widgets/background/Maximise.jsx b/src/components/widgets/background/Maximise.jsx index d4337b0c..4a2009dc 100644 --- a/src/components/widgets/background/Maximise.jsx +++ b/src/components/widgets/background/Maximise.jsx @@ -1,7 +1,6 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { MdCropFree } from 'react-icons/md'; -//import Hotkeys from 'react-hot-keys'; import Tooltip from 'components/helpers/tooltip/Tooltip'; @@ -75,7 +74,6 @@ export default class Maximise extends PureComponent { - {/*variables.keybinds.maximiseBackground && variables.keybinds.maximiseBackground !== '' ? : null*/} ); } diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index 625d4598..5c1ee86c 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -14,7 +14,6 @@ import { import Tooltip from '../../helpers/tooltip/Tooltip'; import Modal from 'react-modal'; import ShareModal from '../../helpers/sharemodal/ShareModal'; -//import Hotkeys from 'react-hot-keys'; const toDataURL = async (url) => { const res = await fetch(url); diff --git a/src/components/widgets/message/Message.jsx b/src/components/widgets/message/Message.jsx index 9e331b61..6701ec75 100644 --- a/src/components/widgets/message/Message.jsx +++ b/src/components/widgets/message/Message.jsx @@ -26,14 +26,17 @@ export default class Message extends PureComponent { }em`; } }); + const messages = JSON.parse(localStorage.getItem('messages')) || []; this.message.current.style.fontSize = `${ 1.6 * Number((localStorage.getItem('zoomMessage') || 100) / 100) }em`; + if (messages.length === 0) { return (this.message.current.style.display = 'none'); } + this.setState({ messageText: messages[Math.floor(Math.random() * messages.length)], }); diff --git a/src/components/widgets/navbar/Navbar.jsx b/src/components/widgets/navbar/Navbar.jsx index 8233de8d..fda8a34d 100644 --- a/src/components/widgets/navbar/Navbar.jsx +++ b/src/components/widgets/navbar/Navbar.jsx @@ -45,15 +45,12 @@ export default class Navbar extends PureComponent { refresh() { switch (this.refreshValue) { case 'background': - EventBus.dispatch('refresh', 'backgroundrefresh'); - break; + return EventBus.dispatch('refresh', 'backgroundrefresh'); case 'quote': - EventBus.dispatch('refresh', 'quoterefresh'); - break; + return EventBus.dispatch('refresh', 'quoterefresh'); case 'quotebackground': EventBus.dispatch('refresh', 'quoterefresh'); - EventBus.dispatch('refresh', 'backgroundrefresh'); - break; + return EventBus.dispatch('refresh', 'backgroundrefresh'); default: window.location.reload(); } diff --git a/src/components/widgets/navbar/Notes.jsx b/src/components/widgets/navbar/Notes.jsx index f2612f55..7e395165 100644 --- a/src/components/widgets/navbar/Notes.jsx +++ b/src/components/widgets/navbar/Notes.jsx @@ -5,7 +5,6 @@ import { useFloating, shift } from '@floating-ui/react-dom'; import TextareaAutosize from '@mui/material/TextareaAutosize'; import { toast } from 'react-toastify'; import Tooltip from '../../helpers/tooltip/Tooltip'; -//import Hotkeys from 'react-hot-keys'; import { saveFile } from 'modules/helpers/settings/modals'; class Notes extends PureComponent { @@ -32,30 +31,18 @@ class Notes extends PureComponent { } hideNotes() { - if (localStorage.getItem('notesPinned') === 'true') { - this.setState({ - showNotes: true, - }); - } else { - this.setState({ - showNotes: false, - }); - } + this.setState({ + showNotes: (localStorage.getItem('notesPinned') === 'true'), + }); } pin() { variables.stats.postEvent('feature', 'Notes pin'); - if (localStorage.getItem('notesPinned') === 'true') { - localStorage.setItem('notesPinned', false); - this.setState({ - showNotes: false, - }); - } else { - localStorage.setItem('notesPinned', true); - this.setState({ - showNotes: true, - }); - } + const notesPinned = (localStorage.getItem('notesPinned') === 'true'); + localStorage.setItem('notesPinned', !notesPinned); + this.setState({ + showNotes: !notesPinned, + }); } copy() { @@ -124,8 +111,6 @@ class Notes extends PureComponent { onChange={this.setNotes} minRows={5} /> - {/*variables.keybinds.pinNotes && variables.keybinds.pinNotes !== '' ? this.pin()}/> : null*/} - {/*variables.keybinds.copyNotes && variables.keybinds.copyNotes !== '' ? this.copy()}/> : null*/}
)} diff --git a/src/components/widgets/navbar/Todo.jsx b/src/components/widgets/navbar/Todo.jsx index d4ba8b34..22448dba 100644 --- a/src/components/widgets/navbar/Todo.jsx +++ b/src/components/widgets/navbar/Todo.jsx @@ -11,11 +11,9 @@ import TextareaAutosize from '@mui/material/TextareaAutosize'; import Tooltip from '../../helpers/tooltip/Tooltip'; import Checkbox from '@mui/material/Checkbox'; import { shift, useFloating } from '@floating-ui/react-dom'; -//import Hotkeys from 'react-hot-keys'; import { sortableContainer, sortableElement } from 'react-sortable-hoc'; const SortableItem = sortableElement(({ value }) =>
{value}
); - const SortableContainer = sortableContainer(({ children }) =>
{children}
); class Todo extends PureComponent { @@ -55,15 +53,9 @@ class Todo extends PureComponent { } hideTodo() { - if (localStorage.getItem('todoPinned') === 'true') { - this.setState({ - showTodo: true, - }); - } else { - this.setState({ - showTodo: false, - }); - } + this.setState({ + showTodo: (localStorage.getItem('todoPinned') === 'true'), + }); } updateTodo(action, index, data) { diff --git a/src/components/widgets/quicklinks/QuickLinks.jsx b/src/components/widgets/quicklinks/QuickLinks.jsx index 5b92807c..e3cbbb5e 100644 --- a/src/components/widgets/quicklinks/QuickLinks.jsx +++ b/src/components/widgets/quicklinks/QuickLinks.jsx @@ -2,7 +2,6 @@ import variables from 'modules/variables'; import { PureComponent, createRef } from 'react'; import { TextareaAutosize } from '@mui/material'; import { MdAddToPhotos } from 'react-icons/md'; -//import Hotkeys from 'react-hot-keys'; import Tooltip from 'components/helpers/tooltip/Tooltip'; @@ -240,7 +239,6 @@ export default class QuickLinks extends PureComponent { {variables.getMessage('widgets.quicklinks.add')}
- {/*variables.keybinds.toggleQuicklinks && variables.keybinds.toggleQuicklinks !== '' ? : null*/}
); diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index adfda48a..3c11a86b 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -10,7 +10,6 @@ import { } from 'react-icons/md'; import { toast } from 'react-toastify'; -//import Hotkeys from 'react-hot-keys'; import Tooltip from '../../helpers/tooltip/Tooltip'; import Modal from 'react-modal'; @@ -201,11 +200,7 @@ export default class Quote extends PureComponent { ? customQuote[Math.floor(Math.random() * customQuote.length)] : null; - if ( - customQuote && - customQuote !== '' && - customQuote !== 'undefined' - ) { + if (customQuote && customQuote !== '' && customQuote !== 'undefined') { return this.setState({ quote: '"' + customQuote.quote + '"', author: customQuote.author, @@ -448,56 +443,51 @@ export default class Quote extends PureComponent { ) : ( - <> -
-
-
- {this.state.authorimg === undefined || this.state.authorimg ? '' : } -
- {this.state.author !== '' ? ( -
- {this.state.author} - {this.state.authorOccupation !== 'Unknown' ? ( - {this.state.authorOccupation} - ) : null} - - {this.state.authorimglicense - ? this.state.authorimglicense.replace(' undefined. ', ' ') - : null} - -
- ) : ( -
- {/* these are placeholders for skeleton and as such don't need translating */} - loading - loading -
- )} -
- {this.state.authorOccupation !== 'Unknown' && this.state.authorlink !== '' ? ( - - - - {' '} - +
+
+
+ {this.state.authorimg === undefined || this.state.authorimg ? '' : } +
+ {this.state.author !== '' ? ( +
+ {this.state.author} + {this.state.authorOccupation !== 'Unknown' ? ( + {this.state.authorOccupation} ) : null} - {this.state.copy} {this.state.share} {this.state.favourited} + + {this.state.authorimglicense + ? this.state.authorimglicense.replace(' undefined. ', ' ') + : null} +
+ ) : ( +
+ {/* these are placeholders for skeleton and as such don't need translating */} + loading + loading +
+ )} +
+ {this.state.authorOccupation !== 'Unknown' && this.state.authorlink !== '' ? ( + + + + {' '} + + ) : null} + {this.state.copy} {this.state.share} {this.state.favourited}
- +
)} - {/*variables.keybinds.favouriteQuote && variables.keybinds.favouriteQuote !== '' ? this.favourite()} /> : null*/} - {/*variables.keybinds.tweetQuote && variables.keybinds.tweetQuote !== '' ? this.tweetQuote()} /> : null*/} - {/*variables.keybinds.copyQuote && variables.keybinds.copyQuote !== '' ? this.copyQuote()} /> : null*/}
); } diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx index 41b59e65..ddf46113 100644 --- a/src/components/widgets/search/Search.jsx +++ b/src/components/widgets/search/Search.jsx @@ -2,7 +2,6 @@ import variables from 'modules/variables'; import { PureComponent, createRef } from 'react'; import { MdSearch, MdMic, MdSettings } from 'react-icons/md'; import Tooltip from 'components/helpers/tooltip/Tooltip'; -//import Hotkeys from 'react-hot-keys'; import AutocompleteInput from 'components/helpers/autocomplete/Autocomplete'; @@ -227,7 +226,6 @@ export default class Search extends PureComponent { onChange={(e) => this.getSuggestions(e)} onClick={this.searchButton} /> - {/*variables.keybinds.focusSearch && variables.keybinds.focusSearch !== '' ? document.getElementById('searchtext').focus()}/> : null*/}
diff --git a/src/components/widgets/time/Clock.jsx b/src/components/widgets/time/Clock.jsx index 5191af2f..dab3d96d 100644 --- a/src/components/widgets/time/Clock.jsx +++ b/src/components/widgets/time/Clock.jsx @@ -153,21 +153,12 @@ export default class Clock extends PureComponent { } render() { - let clockHTML = ( - <> - - {this.state.time} - {this.state.ampm} - - - ); - const enabled = (setting) => { return localStorage.getItem(setting) === 'true'; }; if (localStorage.getItem('timeType') === 'analogue') { - clockHTML = ( + return ( }>
- - {' '} -
- {this.state.finalHour} -
{' '} -
- {this.state.finalMinute} -
{' '} -
{this.state.finalSeconds}
{' '} -
- + return ( + + {' '} +
+ {this.state.finalHour} +
{' '} +
+ {this.state.finalMinute} +
{' '} +
{this.state.finalSeconds}
{' '} +
); } - return clockHTML; + return ( + + {this.state.time} + {this.state.ampm} + + ); } } diff --git a/src/components/widgets/weather/Weather.jsx b/src/components/widgets/weather/Weather.jsx index 74cf166c..0536edbc 100644 --- a/src/components/widgets/weather/Weather.jsx +++ b/src/components/widgets/weather/Weather.jsx @@ -190,12 +190,10 @@ export default class Weather extends PureComponent { {this.state.weather.wind_speed} m/s{' '} {enabled('windDirection') ? ( -
- -
+ ) : null} @@ -222,9 +220,7 @@ export default class Weather extends PureComponent { placement="left" > -
- -
+ {this.state.weather.description}
@@ -244,42 +240,49 @@ export default class Weather extends PureComponent { ) : null} + {enabled('humidity') ? ( + + + + {this.state.weather.humdity} + + + ) : null}
); }; return (
-
-
- {localStorage.getItem('weatherType') >= 1 && ( -
- - {this.state.weather.temp + this.state.temp_text} -
- )} - {localStorage.getItem('weatherType') >= 2 && ( - - - {this.state.weather.temp_min + this.state.temp_text} - - - {this.state.weather.temp_max + this.state.temp_text} - - - )} -
- {localStorage.getItem('weatherType') >= 2 && ( -
- - {variables.getMessage('widgets.weather.feels_like', { - amount: this.state.weather.temp_feels_like + this.state.temp_text, - })} - - {this.state.location} +
+ {weatherType >= 1 && ( +
+ + {this.state.weather.temp + this.state.temp_text}
)} + {weatherType >= 2 && ( + + {this.state.weather.temp_min + this.state.temp_text} + {this.state.weather.temp_max + this.state.temp_text} + + )}
+ {weatherType >= 2 && ( +
+ + {variables.getMessage('widgets.weather.feels_like', { + amount: this.state.weather.temp_feels_like + this.state.temp_text, + })} + + {this.state.location} +
+ )} {weatherType >= 3 ? expandedInfo() : null}
); diff --git a/src/index.jsx b/src/index.jsx index 32c6b98d..315adbac 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -51,10 +51,6 @@ if (localStorage.getItem('stats') === 'true') { variables.stats = Stats; } -/*if (localStorage.getItem('keybindsEnabled') === 'true') { - variables.keybinds = JSON.parse(localStorage.getItem('keybinds') || '{}'); -}*/ - Sentry.init({ dsn: variables.constants.SENTRY_DSN, defaultIntegrations: false, diff --git a/src/modules/variables.js b/src/modules/variables.js index b196c3ad..a5c5a3c8 100644 --- a/src/modules/variables.js +++ b/src/modules/variables.js @@ -7,7 +7,6 @@ const variables = { tabLoad: () => '', postEvent: () => '', }, - //keybinds: {}, constants, }; diff --git a/src/translations/de_DE.json b/src/translations/de_DE.json index 76b8232c..006dcd75 100644 --- a/src/translations/de_DE.json +++ b/src/translations/de_DE.json @@ -419,29 +419,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Tastenbindungen", - "recording": "Aufnahme...", - "click_to_record": "Klicken Sie zum Aufzeichnen", - "background": { - "favourite": "Bevorzugter Hintergrund", - "maximise": "Hintergrund maximieren", - "download": "Hintergrund herunterladen", - "show_info": "Hintergrundinformationen anzeigen" - }, - "quote": { - "favourite": "Lieblings Zitate", - "copy": "Zitat kopieren", - "tweet": "Zitat twittern" - }, - "notes": { - "pin": "Notizen Anheften", - "copy": "Notizen kopieren" - }, - "search": "Fokus Suche", - "quicklinks": "Umschalten auf Quicklink hinzufügen", - "modal": "Modal umschalten" - }, "experimental": { "title": "Experimentell", "warning": "Diese Einstellungen sind nicht vollständig getestet/implementiert und funktionieren möglicherweise nicht korrekt!", diff --git a/src/translations/en_GB.json b/src/translations/en_GB.json index 59d111f8..ced5a1b0 100644 --- a/src/translations/en_GB.json +++ b/src/translations/en_GB.json @@ -417,29 +417,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Experimental", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/en_US.json b/src/translations/en_US.json index c13a66d5..d633c9cd 100644 --- a/src/translations/en_US.json +++ b/src/translations/en_US.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Experimental", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/es.json b/src/translations/es.json index e5b7f5cc..71f2057c 100644 --- a/src/translations/es.json +++ b/src/translations/es.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Asignación de teclas", - "recording": "Grabando...", - "click_to_record": "Click para grabar", - "background": { - "favourite": "Fondo favorito", - "maximise": "Maximizar fondo", - "download": "Descargar fondo", - "show_info": "Mostrar información del fondo" - }, - "quote": { - "favourite": "Marcar la cita como favorita", - "copy": "Copiar cita", - "tweet": "Tuitear la cita" - }, - "notes": { - "pin": "Fijar notas", - "copy": "Copiar notas" - }, - "search": "Enfocar búsqueda", - "quicklinks": "Alternar añadir enlace rápido", - "modal": "Alternal modal" - }, "experimental": { "title": "Experimental", "warning": "Estos ajustes no han sido totalmente probados/implementados y pueden no funcionar correctamente.", diff --git a/src/translations/fr.json b/src/translations/fr.json index 83f3fa22..cca68885 100644 --- a/src/translations/fr.json +++ b/src/translations/fr.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Expérimental", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/id_ID.json b/src/translations/id_ID.json index 58a138d5..017d2451 100644 --- a/src/translations/id_ID.json +++ b/src/translations/id_ID.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Experimental", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/nl.json b/src/translations/nl.json index 3d505622..593ab8f0 100644 --- a/src/translations/nl.json +++ b/src/translations/nl.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Experimenteel", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/no.json b/src/translations/no.json index 1eceb7d2..6e94db06 100644 --- a/src/translations/no.json +++ b/src/translations/no.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Eksperimental", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/ru.json b/src/translations/ru.json index 1fbb970b..711629c8 100644 --- a/src/translations/ru.json +++ b/src/translations/ru.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Keybinds", - "recording": "Recording...", - "click_to_record": "Click to record", - "background": { - "favourite": "Favourite background", - "maximise": "Maximise background", - "download": "Download background", - "show_info": "Show background information" - }, - "quote": { - "favourite": "Favourite quote", - "copy": "Copy quote", - "tweet": "Tweet quote" - }, - "notes": { - "pin": "Pin notes", - "copy": "Copy notes" - }, - "search": "Focus search", - "quicklinks": "Toggle add quick link", - "modal": "Toggle modal" - }, "experimental": { "title": "Экспериментальные настройки", "warning": "These settings have not been fully tested/implemented and may not work correctly!", diff --git a/src/translations/tr_TR.json b/src/translations/tr_TR.json index e598b936..551d88b1 100644 --- a/src/translations/tr_TR.json +++ b/src/translations/tr_TR.json @@ -418,29 +418,6 @@ "achievements": "Başarılar", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "Tuş Atamaları", - "recording": "Kayıt Ediliyor...", - "click_to_record": "Kaydetmek için tıklayın.", - "background": { - "favourite": "Arka planı favorilere ekle.", - "maximise": "Arka planı büyüt.", - "download": "Arka planı indir.", - "show_info": "Arka plan bilgilerini göster." - }, - "quote": { - "favourite": "Alıntıyı favorilere ekle", - "copy": "Alıntıyı kopyala", - "tweet": "Alıntıyı Tweet'le" - }, - "notes": { - "pin": "Notları sabitle", - "copy": "Notları kopyala" - }, - "search": "Odaklı arama", - "quicklinks": "Geçiş hızlı bağlantı ekle.", - "modal": "Modeli aç/kapat." - }, "experimental": { "title": "Deneysel Özellikler", "warning": "Bu ayarlar tam olarak test edilmedi/uygulanmadı ve düzgün çalışmayabilir!", diff --git a/src/translations/zh_CN.json b/src/translations/zh_CN.json index 66218d39..5a5d4c08 100644 --- a/src/translations/zh_CN.json +++ b/src/translations/zh_CN.json @@ -418,29 +418,6 @@ "achievements": "Achievements", "unlocked": "{count} Unlocked" }, - "keybinds": { - "title": "快捷键", - "recording": "等待按下快捷键...", - "click_to_record": "点击后输入快捷键", - "background": { - "favourite": "收藏背景", - "maximise": "仅显示背景", - "download": "下载背景", - "show_info": "显示背景图片信息" - }, - "quote": { - "favourite": "收藏名言", - "copy": "复制名言", - "tweet": "发推名言" - }, - "notes": { - "pin": "贴住便签", - "copy": "复制便签" - }, - "search": "移动光标到搜索框", - "quicklinks": "显示添加快捷方式对话框", - "modal": "显示设置" - }, "experimental": { "title": "实验性功能", "warning": "以下设置仍未完成编写或测试,可能无法正常运作!",