fix: cleanup code and fix weather etc

Co-authored-by: Alex Sparkes <turbomarshmello@gmail.com>
This commit is contained in:
David Ralph
2022-08-31 13:31:49 +01:00
parent 8ca70e7895
commit 2563850fcc
36 changed files with 143 additions and 773 deletions

View File

@@ -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 {
<Welcome modalClose={() => this.closeWelcome()} modalSkip={() => this.previewWelcome()} />
</Modal>
{this.state.preview ? <Preview setup={() => window.location.reload()} /> : null}
{/*variables.keybinds.toggleModal && variables.keybinds.toggleModal !== '' ? <Hotkeys keyName={variables.keybinds.toggleModal} onKeyDown={() => this.toggleModal('mainModal', (this.state.mainModal === true ? false : true))}/> : null*/}
</>
);
}

View File

@@ -82,14 +82,6 @@ h4 {
cursor: pointer;
}
.keybind-table {
text-align: left;
th {
padding-right: 10px;
}
}
.photosEmpty {
height: 400px;
display: grid;

View File

@@ -41,21 +41,19 @@ export default class Checkbox extends PureComponent {
render() {
return (
<>
<FormControlLabel
control={
<CheckboxUI
name={this.props.name}
color="primary"
className="checkbox"
checked={this.state.checked}
onChange={this.handleChange}
disabled={this.props.disabled || false}
/>
}
label={this.props.text}
/>
</>
<FormControlLabel
control={
<CheckboxUI
name={this.props.name}
color="primary"
className="checkbox"
checked={this.state.checked}
onChange={this.handleChange}
disabled={this.props.disabled || false}
/>
}
label={this.props.text}
/>
);
}
}

View File

@@ -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 (
<button
className="cleanButton"
style={{ visibility: 'hidden' }}
onClick={() => props.action('reset', props.setting)}
>
<MdCancel />
</button>
);
} else if (value === variables.getMessage('modals.main.settings.sections.keybinds.recording')) {
return (
<button className="cleanButton" onClick={() => props.action('cancel', props.setting)}>
<MdCancel />
</button>
);
} else {
return (
<button className="cleanButton" onClick={() => props.action('reset', props.setting)}>
<MdCancel />
</button>
);
}
};
return (
<>
<TextField
label={props.name}
onClick={() => 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()}
</>
);
}

View File

@@ -37,20 +37,18 @@ export default class Switch extends PureComponent {
render() {
return (
<>
<FormControlLabel
control={
<SwitchUI
name={this.props.name}
color="primary"
checked={this.state.checked}
onChange={this.handleChange}
/>
}
label={this.props.header ? '' : this.props.text}
labelPlacement="start"
/>
</>
<FormControlLabel
control={
<SwitchUI
name={this.props.name}
color="primary"
checked={this.state.checked}
onChange={this.handleChange}
/>
}
label={this.props.header ? '' : this.props.text}
labelPlacement="start"
/>
);
}
}

View File

@@ -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 (
<>
<Header
title={variables.getMessage('modals.main.settings.sections.keybinds.title')}
setting="keybindsEnabled"
element=".other"
/>
<table className="keybind-table">
<tbody>
<tr>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.background.favourite',
)}
state={this.state.keybinds}
setting="favouriteBackground"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.background.maximise',
)}
state={this.state.keybinds}
setting="maximiseBackground"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.background.download',
)}
state={this.state.keybinds}
setting="downloadBackground"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.background.show_info',
)}
state={this.state.keybinds}
setting="showBackgroundInformation"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.background.show_info',
)}
state={this.state.keybinds}
setting="showBackgroundInformation"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage(
'modals.main.settings.sections.keybinds.quote.favourite',
)}
state={this.state.keybinds}
setting="favouriteQuote"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.quote.copy')}
state={this.state.keybinds}
setting="copyQuote"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.quote.tweet')}
state={this.state.keybinds}
setting="tweetQuote"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.notes.pin')}
state={this.state.keybinds}
setting="pinNotes"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.notes.copy')}
state={this.state.keybinds}
setting="copyNotes"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.search')}
state={this.state.keybinds}
setting="focusSearch"
action={(type, e) => this.action(type, e)}
/>
</th>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.quicklinks')}
state={this.state.keybinds}
setting="toggleQuicklinks"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
<tr>
<th>
<KeybindInput
name={variables.getMessage('modals.main.settings.sections.keybinds.modal')}
state={this.state.keybinds}
setting="toggleModal"
action={(type, e) => this.action(type, e)}
/>
</th>
</tr>
</tbody>
</table>
</>
);
}
}

View File

@@ -114,7 +114,7 @@ export default class OrderSettings extends PureComponent {
</span>*/}
<div className="overviewGrid">
<div>
<span className="title">Preview</span>
<span className="title">{variables.getMessage('modals.welcome.buttons.preview')}</span>
<div className="tabPreview">
<div className="previewItem" style={{ maxWidth: '50%' }}>
{this.state.items.map((value, index) => {

View File

@@ -60,6 +60,7 @@ export default class TimeSettings extends PureComponent {
render() {
const weatherType = localStorage.getItem('weatherType');
return (
<>
<Header

View File

@@ -15,7 +15,6 @@ import Weather from '../settings/sections/Weather';
import Appearance from '../settings/sections/Appearance';
import Language from '../settings/sections/Language';
import Advanced from '../settings/sections/advanced/Advanced';
//import Keybinds from '../settings/sections/Keybinds';
import Stats from '../settings/sections/Stats';
import Experimental from '../settings/sections/Experimental';
import Changelog from '../settings/sections/Changelog';
@@ -93,7 +92,6 @@ export default function Settings(props) {
>
<Advanced />
</div>
{/*<div label={variables.getMessage('modals.main.settings.sections.keybinds.title')} name='keybinds'><Keybinds/></div>*/}
<div label={variables.getMessage('modals.main.settings.sections.stats.title')} name="stats">
<Stats />
</div>

View File

@@ -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 = <Advanced />;
break;
//case variables.getMessage('modals.main.settings.sections.keybinds.title'): icon = <Keybinds/>; break;
case variables.getMessage('modals.main.settings.sections.stats.title'):
icon = <Stats />;
break;

View File

@@ -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 !== '' ? <Hotkeys keyName={variables.keybinds.favouriteBackground} onKeyDown={() => this.favourite()} /> : null*/}
</>
);
return this.state.favourited;
}
}

View File

@@ -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 {
<button>
<MdCropFree onClick={this.maximise} className="topicons" />
</button>
{/*variables.keybinds.maximiseBackground && variables.keybinds.maximiseBackground !== '' ? <Hotkeys keyName={variables.keybinds.maximiseBackground} onKeyDown={this.maximise} /> : null*/}
</Tooltip>
);
}

View File

@@ -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);

View File

@@ -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)],
});

View File

@@ -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();
}

View File

@@ -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 !== '' ? <Hotkeys keyName={variables.keybinds.pinNotes} onKeyDown={() => this.pin()}/> : null*/}
{/*variables.keybinds.copyNotes && variables.keybinds.copyNotes !== '' ? <Hotkeys keyName={variables.keybinds.copyNotes} onKeyDown={() => this.copy()}/> : null*/}
</div>
</span>
)}

View File

@@ -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 }) => <div>{value}</div>);
const SortableContainer = sortableContainer(({ children }) => <div>{children}</div>);
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) {

View File

@@ -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 {
<MdAddToPhotos /> {variables.getMessage('widgets.quicklinks.add')}
</button>
</div>
{/*variables.keybinds.toggleQuicklinks && variables.keybinds.toggleQuicklinks !== '' ? <Hotkeys keyName={variables.keybinds.toggleQuicklinks} onKeyDown={this.toggleAdd} /> : null*/}
</div>
</>
);

View File

@@ -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 {
</div>
</>
) : (
<>
<div className="author-holder">
<div className="author">
<div
className="author-img"
style={{ backgroundImage: `url(${this.state.authorimg})` }}
>
{this.state.authorimg === undefined || this.state.authorimg ? '' : <MdPerson />}
</div>
{this.state.author !== '' ? (
<div className="author-content" ref={this.quoteauthor}>
<span className="title">{this.state.author}</span>
{this.state.authorOccupation !== 'Unknown' ? (
<span className="subtitle">{this.state.authorOccupation}</span>
) : null}
<span className="author-license">
{this.state.authorimglicense
? this.state.authorimglicense.replace(' undefined. ', ' ')
: null}
</span>
</div>
) : (
<div className="author-content whileLoading" ref={this.quoteauthor}>
{/* these are placeholders for skeleton and as such don't need translating */}
<span className="title">loading</span>
<span className="subtitle">loading</span>
</div>
)}
<div className="quote-buttons">
{this.state.authorOccupation !== 'Unknown' && this.state.authorlink !== '' ? (
<Tooltip title={variables.getMessage('widgets.quote.link_tooltip')}>
<a
href={this.state.authorlink}
className="quoteAuthorLink"
target="_blank"
rel="noopener noreferrer"
>
<MdOpenInNew />
</a>{' '}
</Tooltip>
<div className="author-holder">
<div className="author">
<div
className="author-img"
style={{ backgroundImage: `url(${this.state.authorimg})` }}
>
{this.state.authorimg === undefined || this.state.authorimg ? '' : <MdPerson />}
</div>
{this.state.author !== '' ? (
<div className="author-content" ref={this.quoteauthor}>
<span className="title">{this.state.author}</span>
{this.state.authorOccupation !== 'Unknown' ? (
<span className="subtitle">{this.state.authorOccupation}</span>
) : null}
{this.state.copy} {this.state.share} {this.state.favourited}
<span className="author-license">
{this.state.authorimglicense
? this.state.authorimglicense.replace(' undefined. ', ' ')
: null}
</span>
</div>
) : (
<div className="author-content whileLoading" ref={this.quoteauthor}>
{/* these are placeholders for skeleton and as such don't need translating */}
<span className="title">loading</span>
<span className="subtitle">loading</span>
</div>
)}
<div className="quote-buttons">
{this.state.authorOccupation !== 'Unknown' && this.state.authorlink !== '' ? (
<Tooltip title={variables.getMessage('widgets.quote.link_tooltip')}>
<a
href={this.state.authorlink}
className="quoteAuthorLink"
target="_blank"
rel="noopener noreferrer"
>
<MdOpenInNew />
</a>{' '}
</Tooltip>
) : null}
{this.state.copy} {this.state.share} {this.state.favourited}
</div>
</div>
</>
</div>
)}
{/*variables.keybinds.favouriteQuote && variables.keybinds.favouriteQuote !== '' ? <Hotkeys keyName={variables.keybinds.favouriteQuote} onKeyDown={() => this.favourite()} /> : null*/}
{/*variables.keybinds.tweetQuote && variables.keybinds.tweetQuote !== '' ? <Hotkeys keyName={variables.keybinds.tweetQuote} onKeyDown={() => this.tweetQuote()} /> : null*/}
{/*variables.keybinds.copyQuote && variables.keybinds.copyQuote !== '' ? <Hotkeys keyName={variables.keybinds.copyQuote} onKeyDown={() => this.copyQuote()} /> : null*/}
</div>
);
}

View File

@@ -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 !== '' ? <Hotkeys keyName={variables.keybinds.focusSearch} onKeyDown={() => document.getElementById('searchtext').focus()}/> : null*/}
</form>
</div>
<div>

View File

@@ -153,21 +153,12 @@ export default class Clock extends PureComponent {
}
render() {
let clockHTML = (
<>
<span className="clock clock-container">
{this.state.time}
<span className="ampm">{this.state.ampm}</span>
</span>
</>
);
const enabled = (setting) => {
return localStorage.getItem(setting) === 'true';
};
if (localStorage.getItem('timeType') === 'analogue') {
clockHTML = (
return (
<Suspense fallback={<></>}>
<div className="clockBackground">
<Analog
@@ -185,22 +176,25 @@ export default class Clock extends PureComponent {
}
if (localStorage.getItem('timeType') === 'verticalClock') {
clockHTML = (
<>
<span className="new-clock clock-container">
{' '}
<div className="hour" style={{ color: this.state.hourColour }}>
{this.state.finalHour}
</div>{' '}
<div className="minute" style={{ color: this.state.minuteColour }}>
{this.state.finalMinute}
</div>{' '}
<div className="seconds">{this.state.finalSeconds}</div>{' '}
</span>
</>
return (
<span className="new-clock clock-container">
{' '}
<div className="hour" style={{ color: this.state.hourColour }}>
{this.state.finalHour}
</div>{' '}
<div className="minute" style={{ color: this.state.minuteColour }}>
{this.state.finalMinute}
</div>{' '}
<div className="seconds">{this.state.finalSeconds}</div>{' '}
</span>
);
}
return clockHTML;
return (
<span className="clock clock-container">
{this.state.time}
<span className="ampm">{this.state.ampm}</span>
</span>
);
}
}

View File

@@ -190,12 +190,10 @@ export default class Weather extends PureComponent {
{this.state.weather.wind_speed}
<span className="minmax"> m/s</span>{' '}
{enabled('windDirection') ? (
<div className="weatherIcon">
<WindDirectionIcon
className="weatherIcon"
degrees={this.state.weather.wind_degrees}
/>
</div>
<WindDirectionIcon
className="weatherIcon"
degrees={this.state.weather.wind_degrees}
/>
) : null}
</span>
</Tooltip>
@@ -222,9 +220,7 @@ export default class Weather extends PureComponent {
placement="left"
>
<span>
<div className="weatherIcon">
<WeatherIcon name={this.state.icon} />
</div>
<WeatherIcon classsName="weatherIcon" name={this.state.icon} />
{this.state.weather.description}
</span>
</Tooltip>
@@ -244,42 +240,49 @@ export default class Weather extends PureComponent {
</span>
</Tooltip>
) : null}
{enabled('humidity') ? (
<Tooltip
title={variables.getMessage(
'modals.main.settings.sections.weather.extra_info.humidity',
)}
placement="left"
>
<span>
<WiHumidity style={{ padding: '3px' }} />
{this.state.weather.humdity}
</span>
</Tooltip>
) : null}
</div>
);
};
return (
<div className="weather">
<div>
<div className="top-weather">
{localStorage.getItem('weatherType') >= 1 && (
<div>
<WeatherIcon name={this.state.icon} />
<span>{this.state.weather.temp + this.state.temp_text}</span>
</div>
)}
{localStorage.getItem('weatherType') >= 2 && (
<span className="minmax">
<span className="subtitle">
{this.state.weather.temp_min + this.state.temp_text}
</span>
<span className="subtitle">
{this.state.weather.temp_max + this.state.temp_text}
</span>
</span>
)}
</div>
{localStorage.getItem('weatherType') >= 2 && (
<div className="extra-info">
<span>
{variables.getMessage('widgets.weather.feels_like', {
amount: this.state.weather.temp_feels_like + this.state.temp_text,
})}
</span>
<span className="loc">{this.state.location}</span>
<div className="top-weather">
{weatherType >= 1 && (
<div>
<WeatherIcon name={this.state.icon} />
<span>{this.state.weather.temp + this.state.temp_text}</span>
</div>
)}
{weatherType >= 2 && (
<span className="minmax">
<span className="subtitle">{this.state.weather.temp_min + this.state.temp_text}</span>
<span className="subtitle">{this.state.weather.temp_max + this.state.temp_text}</span>
</span>
)}
</div>
{weatherType >= 2 && (
<div className="extra-info">
<span>
{variables.getMessage('widgets.weather.feels_like', {
amount: this.state.weather.temp_feels_like + this.state.temp_text,
})}
</span>
<span className="loc">{this.state.location}</span>
</div>
)}
{weatherType >= 3 ? expandedInfo() : null}
</div>
);

View File

@@ -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,

View File

@@ -7,7 +7,6 @@ const variables = {
tabLoad: () => '',
postEvent: () => '',
},
//keybinds: {},
constants,
};

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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.",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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!",

View File

@@ -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": "以下设置仍未完成编写或测试,可能无法正常运作!",