From 9981a28638f15b425b3510f34ec3a5d6ea9990d2 Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Wed, 17 Mar 2021 14:01:53 +0100 Subject: [PATCH] style: Unified spacing to 2 and add editor config --- .babelrc | 2 +- .editorconfig | 8 + .env | 2 +- .gitignore | 2 +- CONTRIBUTING.md | 4 +- README.md | 2 +- babel.config.js | 2 +- manifest/background-opera.js | 16 +- manifest/chrome.json | 34 +- manifest/firefox.json | 26 +- manifest/opera.json | 30 +- public/index.html | 3 +- src/App.jsx | 24 +- src/components/ErrorBoundary.jsx | 50 +- src/components/modals/Feedback.jsx | 40 +- src/components/modals/Main.jsx | 2 +- src/components/modals/Update.jsx | 16 +- src/components/modals/Welcome.jsx | 32 +- src/components/modals/marketplace/Item.jsx | 114 ++--- src/components/modals/marketplace/Items.jsx | 30 +- .../modals/marketplace/sections/Added.jsx | 128 ++--- .../marketplace/sections/Marketplace.jsx | 198 ++++---- src/components/modals/settings/Checkbox.jsx | 10 +- src/components/modals/settings/Dropdown.jsx | 2 +- src/components/modals/settings/FileUpload.jsx | 24 +- src/components/modals/settings/Slider.jsx | 14 +- .../modals/settings/sections/About.jsx | 48 +- .../modals/settings/sections/Advanced.jsx | 94 ++-- .../modals/settings/sections/Appearance.jsx | 28 +- .../modals/settings/sections/Background.jsx | 128 ++--- .../modals/settings/sections/Experimental.jsx | 3 +- .../modals/settings/sections/Greeting.jsx | 26 +- .../modals/settings/sections/Language.jsx | 12 +- .../modals/settings/sections/Quote.jsx | 2 +- .../modals/settings/sections/Search.jsx | 58 +-- .../modals/settings/sections/Time.jsx | 2 +- src/components/modals/tabs/Addons.jsx | 26 +- src/components/modals/tabs/Marketplace.jsx | 26 +- src/components/modals/tabs/Settings.jsx | 78 +-- src/components/modals/tabs/backend/Tab.jsx | 120 ++--- src/components/modals/tabs/backend/Tabs.jsx | 2 +- src/components/widgets/Widgets.jsx | 18 +- .../widgets/background/Background.jsx | 14 +- .../widgets/background/Favourite.jsx | 54 +- .../widgets/background/Maximise.jsx | 92 ++-- .../widgets/background/PhotoInformation.jsx | 2 +- .../widgets/background/offline_images.json | 38 +- .../background/scss/_photoinformation.scss | 122 ++--- .../widgets/background/scss/index.scss | 66 +-- src/components/widgets/greeting/Greeting.jsx | 4 +- src/components/widgets/greeting/greeting.scss | 6 +- src/components/widgets/navbar/Navbar.jsx | 2 +- src/components/widgets/navbar/Notes.jsx | 86 ++-- src/components/widgets/navbar/Pin.jsx | 14 +- .../widgets/navbar/scss/_notes.scss | 76 +-- src/components/widgets/navbar/scss/index.scss | 58 +-- src/components/widgets/quote/Quote.jsx | 34 +- .../widgets/quote/offline_quotes.json | 180 ++++--- src/components/widgets/quote/quote.scss | 36 +- src/components/widgets/search/Search.jsx | 8 +- src/components/widgets/search/search.scss | 54 +- .../widgets/search/search_engines.json | 94 ++-- src/components/widgets/time/Clock.jsx | 16 +- src/components/widgets/time/Date.jsx | 22 +- src/components/widgets/time/clock.scss | 22 +- src/index.js | 4 +- src/modules/constants.js | 2 +- src/modules/default_settings.json | 202 ++++---- src/modules/helpers/background/hexToRgb.js | 46 +- src/modules/helpers/background/rgbToHex.js | 28 +- src/modules/helpers/background/rgbToHsv.js | 66 +-- src/modules/helpers/background/setRgba.js | 24 +- src/modules/helpers/marketplace.js | 146 +++--- src/modules/helpers/merge.js | 28 +- src/modules/helpers/settings.js | 184 +++---- src/modules/languages.json | 58 +-- src/modules/other_contributors.json | 10 +- src/scss/_mixins.scss | 42 +- src/scss/_variables.scss | 2 +- src/scss/index.scss | 56 +-- src/scss/modules/_buttons.scss | 2 +- src/scss/modules/_dropdown.scss | 2 +- src/scss/modules/_marketplace.scss | 2 +- src/scss/modules/_settings.scss | 2 +- src/scss/modules/_toast.scss | 44 +- src/scss/modules/modals/_feedback.scss | 84 ++-- src/scss/modules/modals/_main.scss | 460 +++++++++--------- src/scss/modules/modals/_update.scss | 22 +- src/scss/modules/modals/_welcome.scss | 82 ++-- ...-picker-gradient-picker-custom-styles.scss | 10 +- src/translations/en-GB.json | 390 +++++++-------- src/translations/en-US.json | 30 +- src/translations/es.json | 252 +++++----- src/translations/fr.json | 248 +++++----- src/translations/nl.json | 212 ++++---- src/translations/no.json | 212 ++++---- src/translations/ru.json | 250 +++++----- webpack.config.js | 45 +- 98 files changed, 2931 insertions(+), 2902 deletions(-) create mode 100644 .editorconfig diff --git a/.babelrc b/.babelrc index e33295d9..feb5ba89 100644 --- a/.babelrc +++ b/.babelrc @@ -3,4 +3,4 @@ "plugins": ["@babel/plugin-proposal-class-properties", ["@babel/transform-runtime", { "regenerator": true }]] -} \ No newline at end of file +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..3274ec36 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.env b/.env index 7894bd43..e1396d1f 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ GENERATE_SOURCEMAP=false INLINE_RUNTIME_CHUNK=false -SKIP_PREFLIGHT_CHECK=true \ No newline at end of file +SKIP_PREFLIGHT_CHECK=true diff --git a/.gitignore b/.gitignore index 0cea6301..c43278be 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ build/ package-lock.json yarn-error.log .eslintcache -yarn.lock \ No newline at end of file +yarn.lock diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a72434b8..05d4f2f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,7 @@ A bug fix? See if it has fixed the issue fully on both Chromium and Firefox. For implemented. ### Translations -Please don't use Google Translate. When submitting new translations, we'd prefer it if you waited until it's finished before pull requesting or if you opened it as a draft. +Please don't use Google Translate. When submitting new translations, we'd prefer it if you waited until it's finished before pull requesting or if you opened it as a draft. All translation work should be done by copying the ``en-GB.json`` file to a file with your language code as the name, e.g ``fr.json``. ## Development @@ -34,4 +34,4 @@ Inspired features are fine. See the note in general. ## Final Note -Contact us before doing anything if you don't want to have to change 1000 things and/or have your pull request closed. \ No newline at end of file +Contact us before doing anything if you don't want to have to change 1000 things and/or have your pull request closed. diff --git a/README.md b/README.md index 3e40984e..1a554fb3 100644 --- a/README.md +++ b/README.md @@ -150,4 +150,4 @@ Please see our [roadmap](https://github.com/mue/mue/projects) Many thanks to [Highholding](https://discord.bio/p/highholding), [Noa Shapira](#), [Roee Lupo](https://github.com/RoeeLupo), [Jeroen](#), [Glasvegas](https://twitter.com/_glasvegas), [Anders](https://github.com/FuryingFox), [Oded Shapira](https://twitter.com/dondishdev), Jacob Tyrrell and [Nikka Lai](#) for letting us use their wonderful photographs. -And finally, a big thank you to all the [contributors](https://github.com/mue/mue/graphs/contributors)! \ No newline at end of file +And finally, a big thank you to all the [contributors](https://github.com/mue/mue/graphs/contributors)! diff --git a/babel.config.js b/babel.config.js index 6288e7f0..b7c4585f 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 }]] -} \ No newline at end of file +} diff --git a/manifest/background-opera.js b/manifest/background-opera.js index 52809ac0..4624da3f 100644 --- a/manifest/background-opera.js +++ b/manifest/background-opera.js @@ -1,14 +1,14 @@ /* eslint-disable no-undef */ -// Original code sourced from https://forums.opera.com/topic/25046/how-to-disable-completely-the-speed-dial/14 +//Source https://forums.opera.com/topic/25046/how-to-disable-completely-the-speed-dial/14 chrome.tabs.onCreated.addListener((tab) => { - if (tab.status === 'complete' && tab.url === 'chrome://startpage/') chrome.tabs.update(tab.id, { - url: chrome.extension.getURL('index.html') - }); + if (tab.status === 'complete' && tab.url === 'chrome://startpage/') chrome.tabs.update(tab.id, { + url: chrome.extension.getURL('index.html') + }); }); chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { - if (changeInfo.status === 'complete' && tab.url === 'chrome://startpage/') chrome.tabs.update(tabId, { - url: chrome.extension.getURL('index.html') - }); -}); \ No newline at end of file + if (changeInfo.status === 'complete' && tab.url === 'chrome://startpage/') chrome.tabs.update(tabId, { + url: chrome.extension.getURL('index.html') + }); +}); diff --git a/manifest/chrome.json b/manifest/chrome.json index 2e913d2b..e9358e66 100644 --- a/manifest/chrome.json +++ b/manifest/chrome.json @@ -1,18 +1,18 @@ { - "manifest_version": 2, - "offline_enabled": true, - "name": "Mue", - "description": "Fast, open and free-to-use new tab page for most modern browsers.", - "version": "5.0.0", - "browser_action": { - "default_icon": "icons/128x128.png" - }, - "chrome_url_overrides": { - "newtab": "index.html" - }, - "icons": { - "16": "icons/16x16.png", - "48": "icons/48x48.png", - "128": "icons/128x128.png" - } -} \ No newline at end of file + "manifest_version": 2, + "offline_enabled": true, + "name": "Mue", + "description": "Fast, open and free-to-use new tab page for most modern browsers.", + "version": "5.0.0", + "browser_action": { + "default_icon": "icons/128x128.png" + }, + "chrome_url_overrides": { + "newtab": "index.html" + }, + "icons": { + "16": "icons/16x16.png", + "48": "icons/48x48.png", + "128": "icons/128x128.png" + } +} diff --git a/manifest/firefox.json b/manifest/firefox.json index 3e8d660c..d63e01e5 100644 --- a/manifest/firefox.json +++ b/manifest/firefox.json @@ -1,15 +1,15 @@ { - "manifest_version": 2, - "name": "Mue", - "description": "Fast, open and free-to-use new tab page for most modern browsers.", - "version": "5.0.0", - "browser_action": { - "default_icon": "icons/128x128.png" - }, - "chrome_url_overrides": { - "newtab": "index.html" - }, - "chrome_settings_overrides": { - "homepage": "index.html" - } + "manifest_version": 2, + "name": "Mue", + "description": "Fast, open and free-to-use new tab page for most modern browsers.", + "version": "5.0.0", + "browser_action": { + "default_icon": "icons/128x128.png" + }, + "chrome_url_overrides": { + "newtab": "index.html" + }, + "chrome_settings_overrides": { + "homepage": "index.html" + } } diff --git a/manifest/opera.json b/manifest/opera.json index a0021666..3c7338cc 100644 --- a/manifest/opera.json +++ b/manifest/opera.json @@ -1,17 +1,17 @@ { - "manifest_version": 2, - "name": "Mue", - "description": "Fast, open and free-to-use new tab page for most modern browsers.", - "version": "5.0.0", - "browser_action": { - "default_icon": "icons/128x128.png" - }, - "background": { - "scripts": [ - "./background-opera.js" - ] - }, - "permissions": [ - "tabs" + "manifest_version": 2, + "name": "Mue", + "description": "Fast, open and free-to-use new tab page for most modern browsers.", + "version": "5.0.0", + "browser_action": { + "default_icon": "icons/128x128.png" + }, + "background": { + "scripts": [ + "./background-opera.js" ] -} \ No newline at end of file + }, + "permissions": [ + "tabs" + ] +} diff --git a/public/index.html b/public/index.html index 846cd177..10b486b1 100644 --- a/public/index.html +++ b/public/index.html @@ -35,5 +35,4 @@
- - \ No newline at end of file + diff --git a/src/App.jsx b/src/App.jsx index 8074e8b8..cf87f702 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -32,15 +32,15 @@ export default class App extends React.PureComponent { if (!localStorage.getItem('firstRun')) { SettingsFunctions.setDefaultSettings(); } - + if (localStorage.getItem('showWelcome') === 'true') { - this.setState({ - welcomeModal: true + this.setState({ + welcomeModal: true }); } SettingsFunctions.loadSettings(); - + // These lines of code prevent double clicking the page or pressing CTRL + A from highlighting the page document.addEventListener('mousedown', (event) => { if (event.detail > 1) { @@ -49,23 +49,23 @@ export default class App extends React.PureComponent { }, false); document.onkeydown = (e) => { - e = e || window.event; + e = e || window.event; if (!e.ctrlKey) return; let code = e.which || e.keyCode; switch (code) { - case 65: - e.preventDefault(); - e.stopPropagation(); - break; + case 65: + e.preventDefault(); + e.stopPropagation(); + break; } }; } closeWelcome() { localStorage.setItem('showWelcome', false); - this.setState({ - welcomeModal: false + this.setState({ + welcomeModal: false }); } @@ -78,7 +78,7 @@ export default class App extends React.PureComponent { modalClassList += ' dark'; tooltipClassList += ' dark'; } - + const overlayClassList = (localStorage.getItem('animations') === 'true') ? 'Overlay modal-animation' : 'Overlay'; /// language diff --git a/src/components/ErrorBoundary.jsx b/src/components/ErrorBoundary.jsx index 40870073..f3efcf82 100644 --- a/src/components/ErrorBoundary.jsx +++ b/src/components/ErrorBoundary.jsx @@ -1,29 +1,29 @@ import React from 'react'; export default class ErrorBoundary extends React.PureComponent { - constructor(props) { - super(props); - this.state = { - error: false - }; + constructor(props) { + super(props); + this.state = { + error: false + }; + } + + static getDerivedStateFromError(error) { + console.log(error); + return { error: true }; + } + + render() { + if (this.state.error) { + return ( +
+

Error

+

Failed to load this component of Mue.

+ +
+ ) } - - static getDerivedStateFromError(error) { - console.log(error); - return { error: true }; - } - - render() { - if (this.state.error) { - return ( -
-

Error

-

Failed to load this component of Mue.

- -
- ) - } - - return this.props.children; - } -} \ No newline at end of file + + return this.props.children; + } +} diff --git a/src/components/modals/Feedback.jsx b/src/components/modals/Feedback.jsx index e7c65892..f26083a9 100644 --- a/src/components/modals/Feedback.jsx +++ b/src/components/modals/Feedback.jsx @@ -1,23 +1,23 @@ import React from 'react'; export default function FeedbackModal(props) { - return ( -
-

{props.language.modals.feedback.title}

- × - -

- -

- -

- -

- -

- -


- -
- ); -} \ No newline at end of file + return ( +
+

{props.language.modals.feedback.title}

+ × + +

+ +

+ +

+ +

+ +

+ +


+ +
+ ); +} diff --git a/src/components/modals/Main.jsx b/src/components/modals/Main.jsx index ec32f441..a155b2b1 100644 --- a/src/components/modals/Main.jsx +++ b/src/components/modals/Main.jsx @@ -26,4 +26,4 @@ export default function MainModal(props) { ); -} \ No newline at end of file +} diff --git a/src/components/modals/Update.jsx b/src/components/modals/Update.jsx index 8536a4a9..cfe58490 100644 --- a/src/components/modals/Update.jsx +++ b/src/components/modals/Update.jsx @@ -16,7 +16,7 @@ export default class Update extends React.PureComponent { async getUpdate() { const data = await (await fetch(Constants.API_URL + '/getUpdate')).json(); - + if (data.statusCode === 500 || data.title === null) { const supportText = `

${this.props.language.contact_support}: https://muetab.com/contact

`; return this.setState({ @@ -47,11 +47,11 @@ export default class Update extends React.PureComponent { render() { return
- × -

{this.state.title}

-
{this.state.date}
- {this.state.image ? Update : null} -

+ × +

{this.state.title}

+
{this.state.date}
+ {this.state.image ? Update : null} +

; - } -} \ No newline at end of file + } +} diff --git a/src/components/modals/Welcome.jsx b/src/components/modals/Welcome.jsx index 836ad64b..72d5b6fa 100644 --- a/src/components/modals/Welcome.jsx +++ b/src/components/modals/Welcome.jsx @@ -7,20 +7,20 @@ import ForumIcon from '@material-ui/icons/Forum'; export default function WelcomeModal(props) { return (
- × -
-

{props.language.title}

-

Mue Tab

- celebration -

{props.language.information}

-

{props.language.thankyoumessage1},
{props.language.thankyoumessage2}

-

{props.language.support}

- - - -
- -
-
+ × +
+

{props.language.title}

+

Mue Tab

+ celebration +

{props.language.information}

+

{props.language.thankyoumessage1},
{props.language.thankyoumessage2}

+

{props.language.support}

+ + + +
+ +
+ ); -} \ No newline at end of file +} diff --git a/src/components/modals/marketplace/Item.jsx b/src/components/modals/marketplace/Item.jsx index 1e87bb41..22230f24 100644 --- a/src/components/modals/marketplace/Item.jsx +++ b/src/components/modals/marketplace/Item.jsx @@ -3,62 +3,62 @@ import React from 'react'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; export default function Item(props) { - let warningHTML; - try { // For some reason it breaks sometimes so we use try/catch - if (props.content.content.data.quote_api) { - warningHTML = ( -
- -
- ); - } - } catch (e) { - // ignore - } - - let iconsrc = 'https://external-content.duckduckgo.com/iu/?u=' + props.data.icon; // prevent console error - if (!props.data.icon) { - iconsrc = null; - } - - return ( -
-
- -
-

{props.data.name}

- {props.button} -

- product -
-
-

{props.language.information}

-
    -
    -
  • {props.language.last_updated}
  • -
  • {props.data.updated}
  • -
    -
  • {props.language.version}
  • -
  • {props.data.version}
  • -
    -
  • {props.language.author}
  • -
  • {props.data.author}
  • -
-
-
-
    -
  • {props.language.notice.title}
  • -
  • {props.language.notice.description}
  • -
-
- {warningHTML} + let warningHTML; + try { // For some reason it breaks sometimes so we use try/catch + if (props.content.content.data.quote_api) { + warningHTML = ( +
+
    +
  • {this.props.language.quote_warning.title}
  • +
  • {this.props.language.quote_warning.description}
  • +
-
-

{props.language.overview}

-

+ ); + } + } catch (e) { + // ignore + } + + let iconsrc = 'https://external-content.duckduckgo.com/iu/?u=' + props.data.icon; // prevent console error + if (!props.data.icon) { + iconsrc = null; + } + + return ( +
+
+ +
+

{props.data.name}

+ {props.button} +

+ product +
+
+

{props.language.information}

+
    +
    +
  • {props.language.last_updated}
  • +
  • {props.data.updated}
  • +
    +
  • {props.language.version}
  • +
  • {props.data.version}
  • +
    +
  • {props.language.author}
  • +
  • {props.data.author}
  • +
+
+
+
    +
  • {props.language.notice.title}
  • +
  • {props.language.notice.description}
  • +
+
+ {warningHTML}
- ); -} \ No newline at end of file +
+

{props.language.overview}

+

+
+ ); +} diff --git a/src/components/modals/marketplace/Items.jsx b/src/components/modals/marketplace/Items.jsx index acf55904..08042753 100644 --- a/src/components/modals/marketplace/Items.jsx +++ b/src/components/modals/marketplace/Items.jsx @@ -1,20 +1,20 @@ import React from 'react'; export default function Items(props) { - if (props.items.length === 0) { - return null; // todo: add message here - } + if (props.items.length === 0) { + return null; // todo: add message here + } - return ( -
- {props.items.map((item) => -
props.toggleFunction(item.name)} key={item.name}> - icon -
-

{item.display_name ? item.display_name : item.name}

-

{item.author}

-
-
)} + return ( +
+ {props.items.map((item) => +
props.toggleFunction(item.name)} key={item.name}> + icon +
+

{item.display_name ? item.display_name : item.name}

+

{item.author}

- ); -} \ No newline at end of file +
)} +
+ ); +} diff --git a/src/components/modals/marketplace/sections/Added.jsx b/src/components/modals/marketplace/sections/Added.jsx index d9770728..509d21e8 100644 --- a/src/components/modals/marketplace/sections/Added.jsx +++ b/src/components/modals/marketplace/sections/Added.jsx @@ -11,82 +11,82 @@ export default class Added extends React.PureComponent { constructor(...args) { super(...args); this.state = { - installed: JSON.parse(localStorage.getItem('installed')), - current_data: { - type: '', - name: '', - content: {} - }, - item_data: { - name: 'Name', - author: 'Author', - description: 'Description', - updated: '???', - version: '1.0.0', - icon: '' - }, - button: '' + installed: JSON.parse(localStorage.getItem('installed')), + current_data: { + type: '', + name: '', + content: {} + }, + item_data: { + name: 'Name', + author: 'Author', + description: 'Description', + updated: '???', + version: '1.0.0', + icon: '' + }, + button: '' } this.buttons = { - uninstall: , + uninstall: , } } toggle(type, type2, data) { if (type === 'item') { - const installed = JSON.parse(localStorage.getItem('installed')); - const info = installed.find(i => i.name === data); + const installed = JSON.parse(localStorage.getItem('installed')); + const info = installed.find(i => i.name === data); - this.setState({ - current_data: { - type: type2, - name: data, - content: info - }, - item_data: { - name: info.name, - author: info.author, - description: MarketplaceFunctions.urlParser(info.description.replace(/\n/g, '
')), - updated: 'Not Implemented', - version: info.version, - icon: info.screenshot_url - } - }); + this.setState({ + current_data: { + type: type2, + name: data, + content: info + }, + item_data: { + name: info.name, + author: info.author, + description: MarketplaceFunctions.urlParser(info.description.replace(/\n/g, '
')), + updated: 'Not Implemented', + version: info.version, + icon: info.screenshot_url + } + }); - document.getElementById('item').style.display = 'block'; - document.getElementById('marketplace').style.display = 'none'; - } else { - document.getElementById('marketplace').style.display = 'block'; - document.getElementById('item').style.display = 'none'; + document.getElementById('item').style.display = 'block'; + document.getElementById('marketplace').style.display = 'none'; + } else { + document.getElementById('marketplace').style.display = 'block'; + document.getElementById('item').style.display = 'none'; } - this.setState({ - button: this.buttons.uninstall + this.setState({ + button: this.buttons.uninstall }); } manage(type, input) { switch (type) { - case 'install': - MarketplaceFunctions.install(input.type, input, true); - break; - case 'uninstall': - MarketplaceFunctions.uninstall(this.state.current_data.name, this.state.current_data.content.type); - break; - default: - break; + case 'install': + MarketplaceFunctions.install(input.type, input, true); + break; + case 'uninstall': + MarketplaceFunctions.uninstall(this.state.current_data.name, this.state.current_data.content.type); + break; + default: + break; } toast(this.props.toastLanguage[type + 'ed']); let button = ''; if (type === 'install') { - button = this.buttons.uninstall; + button = this.buttons.uninstall; } - this.setState({ - button: button, - installed: JSON.parse(localStorage.getItem('installed')) + this.setState({ + button: button, + installed: JSON.parse(localStorage.getItem('installed')) }); } @@ -94,26 +94,26 @@ export default class Added extends React.PureComponent { let content = this.toggle('item', 'addon', input)} />; if (this.state.installed.length === 0) { - content = ( -
-
- -

Empty

-

Nothing here (yet)

- -
+ content = ( +
+
+ +

Empty

+

Nothing here (yet)

+
- ); +
+ ); } return ( - +
this.manage('install', JSON.parse(e.target.result))} /> {content}
-
+
); } -} \ No newline at end of file +} diff --git a/src/components/modals/marketplace/sections/Marketplace.jsx b/src/components/modals/marketplace/sections/Marketplace.jsx index 748f417b..378cc032 100644 --- a/src/components/modals/marketplace/sections/Marketplace.jsx +++ b/src/components/modals/marketplace/sections/Marketplace.jsx @@ -15,94 +15,94 @@ export default class Marketplace extends React.PureComponent { constructor(...args) { super(...args); this.state = { - items: [], - current_data: { - type: '', - name: '', - content: {} - }, - button: '', - featured: {}, - done: false, - item_data: { - name: 'Name', - author: 'Author', - description: 'Description', - updated: '???', - version: '1.0.0', - icon: '' - } - } - this.buttons = { - uninstall: , - install: + items: [], + current_data: { + type: '', + name: '', + content: {} + }, + button: '', + featured: {}, + done: false, + item_data: { + name: 'Name', + author: 'Author', + description: 'Description', + updated: '???', + version: '1.0.0', + icon: '' } } + this.buttons = { + uninstall: , + install: + } + } async toggle(type, data) { switch (type) { - case 'item': - let info; // get item info - try { - info = await (await fetch(`${Constants.MARKETPLACE_URL}/item/${this.props.type}/${data}`)).json(); - } catch (e) { - return toast(this.props.toastLanguage.error); - } + case 'item': + let info; // get item info + try { + info = await (await fetch(`${Constants.MARKETPLACE_URL}/item/${this.props.type}/${data}`)).json(); + } catch (e) { + return toast(this.props.toastLanguage.error); + } // check if already installed - let button = this.buttons.install; + let button = this.buttons.install; - const installed = JSON.parse(localStorage.getItem('installed')); + const installed = JSON.parse(localStorage.getItem('installed')); - if (installed.some(item => item.name === data)) { - button = this.buttons.uninstall; - } - - this.setState({ - current_data: { type: this.props.type, name: data, content: info }, - item_data: { - name: info.data.name, - author: info.data.author, - description: MarketplaceFunctions.urlParser(info.data.description.replace(/\n/g, '
')), - updated: info.updated, - version: info.data.version, - icon: info.data.screenshot_url - }, - button: button - }); - - document.getElementById('marketplace').style.display = 'none'; - document.getElementById('item').style.display = 'block'; - break; - - default: - document.getElementById('marketplace').style.display = 'block'; - document.getElementById('item').style.display = 'none'; - break; + if (installed.some(item => item.name === data)) { + button = this.buttons.uninstall; } - } + + this.setState({ + current_data: { type: this.props.type, name: data, content: info }, + item_data: { + name: info.data.name, + author: info.data.author, + description: MarketplaceFunctions.urlParser(info.data.description.replace(/\n/g, '
')), + updated: info.updated, + version: info.data.version, + icon: info.data.screenshot_url + }, + button: button + }); + + document.getElementById('marketplace').style.display = 'none'; + document.getElementById('item').style.display = 'block'; + break; + + default: + document.getElementById('marketplace').style.display = 'block'; + document.getElementById('item').style.display = 'none'; + break; + } + } async getItems() { const { data } = await (await fetch(Constants.MARKETPLACE_URL + '/all')).json(); const featured = await (await fetch(Constants.MARKETPLACE_URL + '/featured')).json(); this.setState({ - items: data[this.props.type], - featured: featured.data, - done: true + items: data[this.props.type], + featured: featured.data, + done: true }); } manage(type) { switch (type) { - case 'install': - MarketplaceFunctions.install(this.state.current_data.type, this.state.current_data.content.data); - break; - case 'uninstall': - MarketplaceFunctions.uninstall(this.state.current_data.content.data.name, this.state.current_data.type); - break; - default: - break; + case 'install': + MarketplaceFunctions.install(this.state.current_data.type, this.state.current_data.content.data); + break; + case 'uninstall': + MarketplaceFunctions.uninstall(this.state.current_data.content.data.name, this.state.current_data.type); + break; + default: + break; } toast(this.props.toastLanguage[type + 'ed']); @@ -125,31 +125,31 @@ export default class Marketplace extends React.PureComponent { render() { const errorMessage = (msg) => { - return ( -
-
- {msg} -
-
- ); + return ( +
+
+ {msg} +
+
+ ); } if (navigator.onLine === false) { - return errorMessage( - - -

Offline

-

Mue down!

-
- ); + return errorMessage( + + +

Offline

+

Mue down!

+
+ ); } if (localStorage.getItem('offlineMode') === 'true') { return errorMessage( - -

Offline mode is enabled

-

Please turn off offline mode to access the marketplace

+ +

Offline mode is enabled

+

Please turn off offline mode to access the marketplace

); } @@ -159,18 +159,18 @@ export default class Marketplace extends React.PureComponent { } return ( - -
-
-

{this.state.featured.title}

-

{this.state.featured.name}

- -
- this.toggle('item', input)} /> -
-
- ); - } -} \ No newline at end of file + +
+
+

{this.state.featured.title}

+

{this.state.featured.name}

+ +
+ this.toggle('item', input)} /> +
+
+ ); + } +} diff --git a/src/components/modals/settings/Checkbox.jsx b/src/components/modals/settings/Checkbox.jsx index b91ffa23..4a8bfabf 100644 --- a/src/components/modals/settings/Checkbox.jsx +++ b/src/components/modals/settings/Checkbox.jsx @@ -15,15 +15,15 @@ export default class Checkbox extends React.PureComponent { handleChange(name) { SettingsFunctions.setItem(name); - - this.setState({ - checked: (this.state.checked === true) ? false : true + + this.setState({ + checked: (this.state.checked === true) ? false : true }); } render() { let text = this.props.text; - + if (this.props.newFeature) { text = {this.props.text} NEW; } else if (this.props.betaFeature) { @@ -40,4 +40,4 @@ export default class Checkbox extends React.PureComponent { ); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/Dropdown.jsx b/src/components/modals/settings/Dropdown.jsx index ea65294d..95c81fc5 100644 --- a/src/components/modals/settings/Dropdown.jsx +++ b/src/components/modals/settings/Dropdown.jsx @@ -17,4 +17,4 @@ export default class Dropdown extends React.PureComponent { ); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/FileUpload.jsx b/src/components/modals/settings/FileUpload.jsx index 22e5c7c7..f06e9381 100644 --- a/src/components/modals/settings/FileUpload.jsx +++ b/src/components/modals/settings/FileUpload.jsx @@ -5,24 +5,24 @@ import { toast } from 'react-toastify'; export default class FileUpload extends React.PureComponent { componentDidMount() { document.getElementById(this.props.id).onchange = (e) => { - const reader = new FileReader(); - const file = e.target.files[0]; + const reader = new FileReader(); + const file = e.target.files[0]; - if (this.props.type === 'settings') { - reader.readAsText(file, 'UTF-8'); - } else { // background upload - if (file.size > 2000000) { - return toast('File is over 2MB'); - } - - reader.readAsDataURL(file); + if (this.props.type === 'settings') { + reader.readAsText(file, 'UTF-8'); + } else { // background upload + if (file.size > 2000000) { + return toast('File is over 2MB'); } - reader.addEventListener('load', (e) => this.props.loadFunction(e)); + reader.readAsDataURL(file); + } + + reader.addEventListener('load', (e) => this.props.loadFunction(e)); }; } render() { return ; } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/Slider.jsx b/src/components/modals/settings/Slider.jsx index 3f7f3c94..a9b04468 100644 --- a/src/components/modals/settings/Slider.jsx +++ b/src/components/modals/settings/Slider.jsx @@ -15,17 +15,17 @@ export default class Slider extends React.PureComponent { SettingsFunctions.setItem(setText); - this.setState({ - checked: (this.state.checked === true) ? false : true + this.setState({ + checked: (this.state.checked === true) ? false : true }); } render() { return ( - + ); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/About.jsx b/src/components/modals/settings/sections/About.jsx index fe4ba3ba..acc42e4d 100644 --- a/src/components/modals/settings/sections/About.jsx +++ b/src/components/modals/settings/sections/About.jsx @@ -25,9 +25,9 @@ export default class About extends React.PureComponent { updateMsg = 'Update available: ' + version; } - this.setState({ - contributors: contributors, // TODO: REMOVE BOTS AND MAKE IT ACTUALLY WORK, - update: updateMsg + this.setState({ + contributors: contributors, // TODO: REMOVE BOTS AND MAKE IT ACTUALLY WORK, + update: updateMsg }); } @@ -38,27 +38,27 @@ export default class About extends React.PureComponent { render() { return (
-

About

- Mue logo -

Copyright 2018-{new Date().getFullYear()} Mue Tab (BSD-3 License)

-

Version {Constants.VERSION} ({this.state.update})

-

Resources Used

-

Pexels (Background Images)

-

Google (Pin Icon)

-

Contributors

- {this.state.contributors.map((item) => - - {item.login} - - )} - {other_contributors.map((item) => // for those who contributed without opening a pull request - - {item.login} - - )} -

Supporters

-

to be implemented

+

About

+ Mue logo +

Copyright 2018-{new Date().getFullYear()} Mue Tab (BSD-3 License)

+

Version {Constants.VERSION} ({this.state.update})

+

Resources Used

+

Pexels (Background Images)

+

Google (Pin Icon)

+

Contributors

+ {this.state.contributors.map((item) => + + {item.login} + + )} + {other_contributors.map((item) => // for those who contributed without opening a pull request + + {item.login} + + )} +

Supporters

+

to be implemented

); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Advanced.jsx b/src/components/modals/settings/sections/Advanced.jsx index c3864144..eb69cdde 100644 --- a/src/components/modals/settings/sections/Advanced.jsx +++ b/src/components/modals/settings/sections/Advanced.jsx @@ -8,52 +8,52 @@ import SettingsFunctions from '../../../../modules/helpers/settings'; import { toast } from 'react-toastify'; export default class AdvancedSettings extends React.PureComponent { - resetItem() { - document.getElementById('customcss').value = ''; - toast(this.props.toastLanguage.reset); - } - - componentDidMount() { - document.getElementById('customcss').value = localStorage.getItem('customcss'); - } - - settingsImport(e) { - const content = JSON.parse(e.target.result); - - for (const key of Object.keys(content)) { - localStorage.setItem(key, content[key]); - } - - toast(this.props.toastLanguage.imported); - } - - componentWillUnmount() { - localStorage.setItem('customcss', document.getElementById('customcss').value); + resetItem() { + document.getElementById('customcss').value = ''; + toast(this.props.toastLanguage.reset); + } + + componentDidMount() { + document.getElementById('customcss').value = localStorage.getItem('customcss'); + } + + settingsImport(e) { + const content = JSON.parse(e.target.result); + + for (const key of Object.keys(content)) { + localStorage.setItem(key, content[key]); } - render() { - return ( -
-

Advanced

- -

Data

- - - - this.settingsImport(e)} /> -

Customisation

-
    -

    Custom CSS this.resetItem()}>Reset

    - -
-
    -

    Custom JS this.resetItem()}>Reset

    - -
-

Experimental

-

Please note that the Mue team cannot provide support if you have experimental mode on. Please disable it first and see if the issues continue to occur before contacting support.

- -
- ); - } -} \ No newline at end of file + toast(this.props.toastLanguage.imported); + } + + componentWillUnmount() { + localStorage.setItem('customcss', document.getElementById('customcss').value); + } + + render() { + return ( +
+

Advanced

+ +

Data

+ + + + this.settingsImport(e)} /> +

Customisation

+
    +

    Custom CSS this.resetItem()}>Reset

    + +
+
    +

    Custom JS this.resetItem()}>Reset

    + +
+

Experimental

+

Please note that the Mue team cannot provide support if you have experimental mode on. Please disable it first and see if the issues continue to occur before contacting support.

+ +
+ ); + } +} diff --git a/src/components/modals/settings/sections/Appearance.jsx b/src/components/modals/settings/sections/Appearance.jsx index 05da9056..ea0335fb 100644 --- a/src/components/modals/settings/sections/Appearance.jsx +++ b/src/components/modals/settings/sections/Appearance.jsx @@ -4,19 +4,19 @@ import Checkbox from '../Checkbox'; export default function AppearanceSettings (props) { return (
-

{props.language.title}

- - -

Accessibility

- -
    -

    Zoom (100%) {props.language.reset}

    - -
-
    -

    Toast Duration (2500 milliseconds) {props.language.reset}

    - -
+

{props.language.title}

+ + +

Accessibility

+ +
    +

    Zoom (100%) {props.language.reset}

    + +
+
    +

    Toast Duration (2500 milliseconds) {props.language.reset}

    + +
); -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Background.jsx b/src/components/modals/settings/sections/Background.jsx index c1734989..05f856f4 100644 --- a/src/components/modals/settings/sections/Background.jsx +++ b/src/components/modals/settings/sections/Background.jsx @@ -31,30 +31,30 @@ export default class BackgroundSettings extends React.PureComponent { switch (key) { case 'customBackgroundColour': localStorage.setItem('customBackgroundColour', ''); - this.setState({ - gradientSettings: this.DefaultGradientSettings + this.setState({ + gradientSettings: this.DefaultGradientSettings }); break; - case 'customBackground': - document.getElementById('customBackground').value = ''; + case 'customBackground': + document.getElementById('customBackground').value = ''; break; case 'blur': localStorage.setItem('blur', 0); - this.setState({ - blur: 0 + this.setState({ + blur: 0 }); break; case 'brightness': localStorage.setItem('brightness', 100); - this.setState({ - brightness: 100 + this.setState({ + brightness: 100 }); break; - default: + default: toast('resetItem requires a key!'); } @@ -147,21 +147,21 @@ export default class BackgroundSettings extends React.PureComponent { } this.setState({ - gradientSettings: { - 'angle': attrs.degree, - 'gradient': attrs.points.map((p) => { - return { - 'colour': '#' + rgbToHex(p.red, p.green, p.blue), - 'stop': p.left - } }), - 'type': attrs.type + gradientSettings: { + 'angle': attrs.degree, + 'gradient': attrs.points.map((p) => { + return { + 'colour': '#' + rgbToHex(p.red, p.green, p.blue), + 'stop': p.left + }}), + 'type': attrs.type } }); }; fileUpload(e) { localStorage.setItem('customBackground', e.target.result); - this.setState({ + this.setState({ customBackground: e.target.result }); } @@ -186,7 +186,7 @@ export default class BackgroundSettings extends React.PureComponent { if (this.GradientPickerInitalState === undefined) { this.InitializeColorPickerState(this.state.gradientSettings); } - + gradientInputs = ( this.onColorPickerChange(color, 'start')} @@ -217,50 +217,50 @@ export default class BackgroundSettings extends React.PureComponent { } return ( -
-

Background

- -

Buttons

-
    - - - -
-

Effects

-
    -

    {this.props.language.blur} ({this.state.blur}%) this.resetItem('blur')}>{this.props.language.reset}

    - this.setState({ blur: event.target.value })} /> -
-
    -

    {this.props.language.brightness} ({this.state.brightness}%) this.resetItem('brightness')}>{this.props.language.reset}

    - this.setState({ brightness: event.target.value })} /> -
-

Source

-
    - localStorage.setItem('backgroundAPI', document.getElementById('backgroundAPI').value)} > - - - -
-
    -

    {this.props.language.custom_url} this.resetItem('customBackground')}>{this.props.language.reset}

    - this.setState({ customBackground: e.target.value })}> -
-
    -

    {this.props.language.custom_background} this.resetItem('customBackground')}>{this.props.language.reset}

    - - this.fileUpload(e)} /> -
-
    -

    {this.props.language.custom_colour} this.resetItem('customBackgroundColour')}>{this.props.language.reset}

    - - {colourSettings} -
-
+
+

Background

+ +

Buttons

+
    + + + +
+

Effects

+
    +

    {this.props.language.blur} ({this.state.blur}%) this.resetItem('blur')}>{this.props.language.reset}

    + this.setState({ blur: event.target.value })} /> +
+
    +

    {this.props.language.brightness} ({this.state.brightness}%) this.resetItem('brightness')}>{this.props.language.reset}

    + this.setState({ brightness: event.target.value })} /> +
+

Source

+
    + localStorage.setItem('backgroundAPI', document.getElementById('backgroundAPI').value)} > + + + +
+
    +

    {this.props.language.custom_url} this.resetItem('customBackground')}>{this.props.language.reset}

    + this.setState({ customBackground: e.target.value })}> +
+
    +

    {this.props.language.custom_background} this.resetItem('customBackground')}>{this.props.language.reset}

    + + this.fileUpload(e)} /> +
+
    +

    {this.props.language.custom_colour} this.resetItem('customBackgroundColour')}>{this.props.language.reset}

    + + {colourSettings} +
+
); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Experimental.jsx b/src/components/modals/settings/sections/Experimental.jsx index c20d9f4d..ead132ce 100644 --- a/src/components/modals/settings/sections/Experimental.jsx +++ b/src/components/modals/settings/sections/Experimental.jsx @@ -4,7 +4,6 @@ import Checkbox from '../Checkbox'; export default function ExperimentalSettings (props) { return (
-
); -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Greeting.jsx b/src/components/modals/settings/sections/Greeting.jsx index c5d2c0ff..dbb0f66e 100644 --- a/src/components/modals/settings/sections/Greeting.jsx +++ b/src/components/modals/settings/sections/Greeting.jsx @@ -9,29 +9,29 @@ export default class GreetingSettings extends React.PureComponent { constructor(...args) { super(...args); this.state = { - birthday: new Date(localStorage.getItem('birthday')) || new Date(), - greetingName: localStorage.getItem('greetingName') || '' + birthday: new Date(localStorage.getItem('birthday')) || new Date(), + greetingName: localStorage.getItem('greetingName') || '' }; } resetItem() { - this.setState({ - greetingName: '' + this.setState({ + greetingName: '' }); toast(this.props.toastLanguage.reset); } changeDate(data) { - if (data === 'reset') { - return; //soon - } + if (data === 'reset') { + return; //soon + } - localStorage.setItem('birthday', data); - - this.setState({ - birthday: data - }); + localStorage.setItem('birthday', data); + + this.setState({ + birthday: data + }); } componentDidUpdate() { @@ -58,4 +58,4 @@ export default class GreetingSettings extends React.PureComponent {
); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Language.jsx b/src/components/modals/settings/sections/Language.jsx index 418f0f77..5f2e7edb 100644 --- a/src/components/modals/settings/sections/Language.jsx +++ b/src/components/modals/settings/sections/Language.jsx @@ -12,15 +12,15 @@ export default function LanguageSettings (props) { name='language' id='language' onChange={() => localStorage.setItem('language', document.getElementById('language').value)}> - {languages.map(language => - - )} + {languages.map(language => + + )}

Quote {props.language.language}

localStorage.setItem('quotelanguage', document.getElementById('quotelanguage').value)}> - - + +
); -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Quote.jsx b/src/components/modals/settings/sections/Quote.jsx index 96f6adbb..1d2bddcd 100644 --- a/src/components/modals/settings/sections/Quote.jsx +++ b/src/components/modals/settings/sections/Quote.jsx @@ -13,4 +13,4 @@ export default function QuoteSettings (props) {
); -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Search.jsx b/src/components/modals/settings/sections/Search.jsx index 874459fe..9a3f2b02 100644 --- a/src/components/modals/settings/sections/Search.jsx +++ b/src/components/modals/settings/sections/Search.jsx @@ -11,7 +11,7 @@ export default class SearchSettings extends React.PureComponent { resetSearch() { localStorage.removeItem('customSearchEngine'); document.getElementById('customSearchEngine').value = ''; - + toast(this.props.toastLanguage.reset); } @@ -23,7 +23,7 @@ export default class SearchSettings extends React.PureComponent { input.style.display = 'block'; input.enabled = 'true'; - + document.getElementById('customSearchEngine').value = localStorage.getItem('customSearchEngine'); } else { localStorage.removeItem('customSearchEngine'); @@ -36,8 +36,8 @@ export default class SearchSettings extends React.PureComponent { if (document.getElementById('searchEngineInput').enabled === 'true') { const input = document.getElementById('customSearchEngine').value; if (input) { - localStorage.setItem('searchEngine', 'custom'); - localStorage.setItem('customSearchEngine', input); + localStorage.setItem('searchEngine', 'custom'); + localStorage.setItem('customSearchEngine', input); } } } @@ -45,36 +45,36 @@ export default class SearchSettings extends React.PureComponent { setSearchEngine(input) { const searchEngineInput = document.getElementById('searchEngineInput'); if (input === 'custom') { - searchEngineInput.enabled = 'true'; - searchEngineInput.style.display = 'block'; + searchEngineInput.enabled = 'true'; + searchEngineInput.style.display = 'block'; } else { - searchEngineInput.style.display = 'none'; - searchEngineInput.enabled = 'false'; - localStorage.setItem('searchEngine', input); + searchEngineInput.style.display = 'none'; + searchEngineInput.enabled = 'false'; + localStorage.setItem('searchEngine', input); } } render() { return ( -
-

Search

- -
    - this.setSearchEngine(document.getElementById('searchEngine').value)} > - {searchEngines.map((engine) => - - )} - - -
-
    -

    {this.props.language.custom} this.resetSearch()}>{this.props.language.reset}

    - -
-
+
+

Search

+ +
    + this.setSearchEngine(document.getElementById('searchEngine').value)} > + {searchEngines.map((engine) => + + )} + + +
+
    +

    {this.props.language.custom} this.resetSearch()}>{this.props.language.reset}

    + +
+
); } -} \ No newline at end of file +} diff --git a/src/components/modals/settings/sections/Time.jsx b/src/components/modals/settings/sections/Time.jsx index 80046ffb..f684c9e0 100644 --- a/src/components/modals/settings/sections/Time.jsx +++ b/src/components/modals/settings/sections/Time.jsx @@ -24,4 +24,4 @@ export default function TimeSettings (props) {
); -} \ No newline at end of file +} diff --git a/src/components/modals/tabs/Addons.jsx b/src/components/modals/tabs/Addons.jsx index fd599da8..5e72630b 100644 --- a/src/components/modals/tabs/Addons.jsx +++ b/src/components/modals/tabs/Addons.jsx @@ -5,16 +5,16 @@ import Added from '../marketplace/sections/Added'; import AddonsTabs from './backend/Tabs'; export default function Addons (props) { - return ( - - -
- -
-
- -
-
-
- ); -} \ No newline at end of file + return ( + + +
+ +
+
+ +
+
+
+ ); +} diff --git a/src/components/modals/tabs/Marketplace.jsx b/src/components/modals/tabs/Marketplace.jsx index cb660da6..024f8677 100644 --- a/src/components/modals/tabs/Marketplace.jsx +++ b/src/components/modals/tabs/Marketplace.jsx @@ -4,16 +4,16 @@ import MarketplaceBackend from '../marketplace/sections/Marketplace'; import MarketplaceTabs from './backend/Tabs'; export default function Marketplace (props) { - return ( - - -
- -
-
- -
-
-
- ); -} \ No newline at end of file + return ( + + +
+ +
+
+ +
+
+
+ ); +} diff --git a/src/components/modals/tabs/Settings.jsx b/src/components/modals/tabs/Settings.jsx index d889385f..49b7cc94 100644 --- a/src/components/modals/tabs/Settings.jsx +++ b/src/components/modals/tabs/Settings.jsx @@ -13,43 +13,43 @@ import Advanced from '../settings/sections/Advanced'; import SettingsTabs from './backend/Tabs'; export default function Settings (props) { - return ( - - -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
+ return ( + + +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
-
-
- -
-
- -
-
-
- ); -} \ No newline at end of file +
+
+ +
+
+ +
+
+
+ ); +} diff --git a/src/components/modals/tabs/backend/Tab.jsx b/src/components/modals/tabs/backend/Tab.jsx index b99fff20..253a327a 100644 --- a/src/components/modals/tabs/backend/Tab.jsx +++ b/src/components/modals/tabs/backend/Tab.jsx @@ -23,69 +23,69 @@ import Plugins from '@material-ui/icons/Widgets'; import Added from '@material-ui/icons/AddCircle'; export default class Tab extends React.PureComponent { - onClick = () => { - this.props.onClick(this.props.label); - }; + onClick = () => { + this.props.onClick(this.props.label); + }; - render() { - let className = 'tab-list-item'; - if (this.props.currentTab === this.props.label) { - className += ' tab-list-active'; - } + render() { + let className = 'tab-list-item'; + if (this.props.currentTab === this.props.label) { + className += ' tab-list-active'; + } - if (this.props.navbar === true) { - className = 'navbar-item'; - if (this.props.currentTab === this.props.label) { - className += ' navbar-item-active'; - } - } + if (this.props.navbar === true) { + className = 'navbar-item'; + if (this.props.currentTab === this.props.label) { + className += ' navbar-item-active'; + } + } - let icon, divider; - switch (this.props.label) { - // Navbar - case 'Settings': icon = ; break; - case 'My Add-ons': icon = ; break; - case 'Marketplace': icon = ; break; + let icon, divider; + switch (this.props.label) { + // Navbar + case 'Settings': icon = ; break; + case 'My Add-ons': icon = ; break; + case 'Marketplace': icon = ; break; - // Settings - case 'Time': icon =