diff --git a/src/App.jsx b/src/App.jsx
index 873b5279..17be0ffe 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,13 +1,13 @@
import { PureComponent } from 'react';
+import { ToastContainer } from 'react-toastify';
import Background from './components/widgets/background/Background';
import Widgets from './components/widgets/Widgets';
import Modals from './components/modals/Modals';
-import EventBus from './modules/helpers/eventbus';
import { loadSettings, moveSettings } from './modules/helpers/settings';
-import { ToastContainer } from 'react-toastify';
+import EventBus from './modules/helpers/eventbus';
export default class App extends PureComponent {
componentDidMount() {
diff --git a/src/components/modals/ErrorBoundary.jsx b/src/components/modals/ErrorBoundary.jsx
index 91297f29..ee62844f 100644
--- a/src/components/modals/ErrorBoundary.jsx
+++ b/src/components/modals/ErrorBoundary.jsx
@@ -1,6 +1,5 @@
import { PureComponent } from 'react';
-
-import ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';
+import { ErrorOutline } from '@material-ui/icons';
export default class ErrorBoundary extends PureComponent {
constructor(props) {
@@ -24,7 +23,7 @@ export default class ErrorBoundary extends PureComponent {
return (
-
+
{this.language.title}
{this.language.message}
diff --git a/src/components/modals/Modals.jsx b/src/components/modals/Modals.jsx
index 0e2e68c2..21585741 100644
--- a/src/components/modals/Modals.jsx
+++ b/src/components/modals/Modals.jsx
@@ -1,12 +1,11 @@
import { PureComponent, Suspense, lazy } from 'react';
-
-import EventBus from '../../modules/helpers/eventbus';
+import Modal from 'react-modal';
import Main from './main/Main';
import Feedback from './feedback/Feedback';
import Navbar from '../widgets/navbar/Navbar';
-import Modal from 'react-modal';
+import EventBus from '../../modules/helpers/eventbus';
// Welcome modal is lazy loaded as the user won't use it every time they open a tab
// We used to lazy load the main and feedback modals, but doing so broke the modal open animation on first click
diff --git a/src/components/modals/main/marketplace/Item.jsx b/src/components/modals/main/marketplace/Item.jsx
index c35aa54c..b54a9211 100644
--- a/src/components/modals/main/marketplace/Item.jsx
+++ b/src/components/modals/main/marketplace/Item.jsx
@@ -1,11 +1,9 @@
import { PureComponent } from 'react';
-
+import { ArrowBack } from '@material-ui/icons';
import Modal from 'react-modal';
import Lightbox from './Lightbox';
-import ArrowBackIcon from '@material-ui/icons/ArrowBack';
-
export default class Item extends PureComponent {
constructor() {
super();
@@ -42,7 +40,7 @@ export default class Item extends PureComponent {
return (
-
+
{this.props.data.display_name}
{this.props.button}
diff --git a/src/components/modals/main/marketplace/sections/Added.jsx b/src/components/modals/main/marketplace/sections/Added.jsx
index 7321cc72..acc87346 100644
--- a/src/components/modals/main/marketplace/sections/Added.jsx
+++ b/src/components/modals/main/marketplace/sections/Added.jsx
@@ -1,14 +1,13 @@
import { PureComponent } from 'react';
+import { LocalMall } from '@material-ui/icons';
+import { toast } from 'react-toastify';
-import LocalMallIcon from '@material-ui/icons/LocalMall';
import Item from '../Item';
import Items from '../Items';
import Dropdown from '../../settings/Dropdown';
import { uninstall, urlParser } from '../../../../../modules/helpers/marketplace';
-import { toast } from 'react-toastify';
-
export default class Added extends PureComponent {
constructor() {
super();
@@ -100,7 +99,7 @@ export default class Added extends PureComponent {
return (
-
+
{this.language.empty.title}
{this.language.empty.description}
diff --git a/src/components/modals/main/marketplace/sections/Create.jsx b/src/components/modals/main/marketplace/sections/Create.jsx
index d2f58508..82883387 100644
--- a/src/components/modals/main/marketplace/sections/Create.jsx
+++ b/src/components/modals/main/marketplace/sections/Create.jsx
@@ -1,13 +1,14 @@
import { PureComponent } from 'react';
-
-import FileUpload from '../../settings/FileUpload';
-
-import Settings from '@material-ui/icons/SettingsRounded';
-import Photos from '@material-ui/icons/PhotoOutlined';
-import Quotes from '@material-ui/icons/FormatQuoteOutlined';
+import {
+ SettingsRounded as Settings,
+ PhotoOutlined as Photos,
+ FormatQuoteOutlined as Quotes
+} from '@material-ui/icons';
+import { toast } from 'react-toastify';
import { saveFile } from '../../../../../modules/helpers/settings/modals';
-import { toast } from 'react-toastify';
+
+import FileUpload from '../../settings/FileUpload';
import '../../../welcome/welcome.scss';
diff --git a/src/components/modals/main/marketplace/sections/Marketplace.jsx b/src/components/modals/main/marketplace/sections/Marketplace.jsx
index f10862e7..9bfb5f42 100644
--- a/src/components/modals/main/marketplace/sections/Marketplace.jsx
+++ b/src/components/modals/main/marketplace/sections/Marketplace.jsx
@@ -1,7 +1,6 @@
import { PureComponent } from 'react';
-
-import WifiOffIcon from '@material-ui/icons/WifiOff';
-import LocalMallIcon from '@material-ui/icons/LocalMall';
+import { toast } from 'react-toastify';
+import { WifiOff, LocalMall } from '@material-ui/icons';
import Item from '../Item';
import Items from '../Items';
@@ -9,8 +8,6 @@ import Dropdown from '../../settings/Dropdown';
import { install, urlParser, uninstall } from '../../../../../modules/helpers/marketplace';
-import { toast } from 'react-toastify';
-
export default class Marketplace extends PureComponent {
constructor() {
super();
@@ -178,7 +175,7 @@ export default class Marketplace extends PureComponent {
if (navigator.onLine === false || localStorage.getItem('offlineMode') === 'true') {
return errorMessage(<>
-
+
);
diff --git a/src/components/widgets/navbar/Notes.jsx b/src/components/widgets/navbar/Notes.jsx
index d1a9fe61..d1a57c56 100644
--- a/src/components/widgets/navbar/Notes.jsx
+++ b/src/components/widgets/navbar/Notes.jsx
@@ -1,11 +1,6 @@
import { PureComponent } from 'react';
-
+import { FileCopyRounded, AssignmentRounded as NotesRounded, PushPin }from '@material-ui/icons';
import TextareaAutosize from '@material-ui/core/TextareaAutosize';
-
-import CopyIcon from '@material-ui/icons/FileCopyRounded';
-import NotesIcon from '@material-ui/icons/AssignmentRounded';
-import Pin from '@material-ui/icons/PushPin';
-
import { toast } from 'react-toastify';
export default class Notes extends PureComponent {
@@ -57,12 +52,12 @@ export default class Notes extends PureComponent {
return (
-
+
{this.language.title}
-
-
+
+
);
}
diff --git a/src/components/widgets/quicklinks/QuickLinks.jsx b/src/components/widgets/quicklinks/QuickLinks.jsx
index 4bc91d07..e2da58b0 100644
--- a/src/components/widgets/quicklinks/QuickLinks.jsx
+++ b/src/components/widgets/quicklinks/QuickLinks.jsx
@@ -1,10 +1,9 @@
import { PureComponent } from 'react';
+import Tooltip from '../../helpers/tooltip/Tooltip';
+import { TextareaAutosize } from '@material-ui/core';
import EventBus from '../../../modules/helpers/eventbus';
-import Tooltip from '../../helpers/tooltip/Tooltip';
-import TextareaAutosize from '@material-ui/core/TextareaAutosize';
-
import './quicklinks.scss';
export default class QuickLinks extends PureComponent {
@@ -88,15 +87,9 @@ export default class QuickLinks extends PureComponent {
}
toggleAdd = () => {
- if (this.state.showAddLink === 'hidden') {
- this.setState({
- showAddLink: 'visible'
- });
- } else {
- this.setState({
- showAddLink: 'hidden'
- });
- }
+ this.setState({
+ showAddLink: (this.state.showAddLink === 'hidden') ? 'visible' : 'hidden'
+ });
}
// widget zoom
@@ -154,9 +147,9 @@ export default class QuickLinks extends PureComponent {
}
const tooltipEnabled = localStorage.getItem('quicklinkstooltip');
+ const useProxy = (localStorage.getItem('quicklinksddgProxy') !== 'false');
const quickLink = (item) => {
- const useProxy = (localStorage.getItem('quicklinksddgProxy') !== 'false');
const url = useProxy ? 'https://icons.duckduckgo.com/ip2/' : 'https://www.google.com/s2/favicons?sz=32&domain=';
const link = (
@@ -166,7 +159,7 @@ export default class QuickLinks extends PureComponent {
);
if (tooltipEnabled === 'true') {
- return {link};
+ return {link};
} else {
return link;
}
diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx
index a9287c35..b6e12cbc 100644
--- a/src/components/widgets/quote/Quote.jsx
+++ b/src/components/widgets/quote/Quote.jsx
@@ -1,23 +1,18 @@
import { PureComponent } from 'react';
-
-import EventBus from '../../../modules/helpers/eventbus';
-import Interval from '../../../modules/helpers/interval';
-
-import FileCopy from '@material-ui/icons/FilterNone';
-import TwitterIcon from '@material-ui/icons/Twitter';
-import StarIcon from '@material-ui/icons/Star';
-import StarIcon2 from '@material-ui/icons/StarBorder';
-
+import { FilterNone as FileCopy, Twitter, Star, StarBorder } from '@material-ui/icons';
import { toast } from 'react-toastify';
+import Interval from '../../../modules/helpers/interval';
+import EventBus from '../../../modules/helpers/eventbus';
+
import './quote.scss';
export default class Quote extends PureComponent {
buttons = {
- tweet: this.tweetQuote()} />,
+ tweet: this.tweetQuote()} />,
copy: this.copyQuote()} />,
- unfavourited: this.favourite()} />,
- favourited: this.favourite()} />
+ unfavourited: this.favourite()} />,
+ favourited: this.favourite()} />
}
constructor() {
diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx
index b2db9edf..7eb88f4b 100644
--- a/src/components/widgets/search/Search.jsx
+++ b/src/components/widgets/search/Search.jsx
@@ -1,11 +1,9 @@
import { PureComponent } from 'react';
-
-import EventBus from '../../../modules/helpers/eventbus';
+import { Search as SearchIcon, Mic } from '@material-ui/icons';
import AutocompleteInput from '../../helpers/autocomplete/Autocomplete';
-import SearchIcon from '@material-ui/icons/Search';
-import MicIcon from '@material-ui/icons/Mic';
+import EventBus from '../../../modules/helpers/eventbus';
import './search.scss';
@@ -101,7 +99,7 @@ export default class Search extends PureComponent {
}
if (localStorage.getItem('voiceSearch') === 'true') {
- microphone = ;
+ microphone = ;
}
let autocompleteURL, autocompleteQuery, autocompleteCallback;
diff --git a/src/components/widgets/time/Clock.jsx b/src/components/widgets/time/Clock.jsx
index 55c06823..f972d270 100644
--- a/src/components/widgets/time/Clock.jsx
+++ b/src/components/widgets/time/Clock.jsx
@@ -1,6 +1,6 @@
import { PureComponent, Suspense, lazy } from 'react';
-
import { utcToZonedTime } from 'date-fns-tz';
+
import EventBus from '../../../modules/helpers/eventbus';
import './clock.scss';
diff --git a/src/components/widgets/time/Date.jsx b/src/components/widgets/time/Date.jsx
index c0eb4531..54bda298 100644
--- a/src/components/widgets/time/Date.jsx
+++ b/src/components/widgets/time/Date.jsx
@@ -1,9 +1,8 @@
import { PureComponent } from 'react';
-
import { utcToZonedTime } from 'date-fns-tz';
-import EventBus from '../../../modules/helpers/eventbus';
import dtf from '../../../modules/helpers/date';
+import EventBus from '../../../modules/helpers/eventbus';
import './date.scss';
diff --git a/src/components/widgets/weather/Weather.jsx b/src/components/widgets/weather/Weather.jsx
index 3035f2a5..c479dc7c 100644
--- a/src/components/widgets/weather/Weather.jsx
+++ b/src/components/widgets/weather/Weather.jsx
@@ -1,10 +1,10 @@
import { PureComponent } from 'react';
-
-import EventBus from '../../../modules/helpers/eventbus';
+import { WiHumidity, WiWindy, WiBarometer, WiCloud } from 'weather-icons-react';
import WeatherIcon from './WeatherIcon';
import WindDirectionIcon from './WindDirectionIcon';
-import { WiHumidity, WiWindy, WiBarometer, WiCloud } from 'weather-icons-react';
+
+import EventBus from '../../../modules/helpers/eventbus';
import './weather.scss';
@@ -133,10 +133,6 @@ export default class Weather extends PureComponent {
return (localStorage.getItem(setting) === 'true');
};
- if (enabled('offlineMode')) {
- return null;
- }
-
if (this.state.location === window.language.widgets.weather.not_found) {
return (
{this.state.location}
diff --git a/src/index.js b/src/index.js
index 52e58f5a..edc7aaeb 100644
--- a/src/index.js
+++ b/src/index.js
@@ -20,7 +20,6 @@ if (languagecode === 'en') {
window.languagecode = 'en_GB';
}
-// these are merged so if a string is untranslated it doesn't break mue
window.language = require(`./translations/${window.languagecode}.json`);
// set html language tag