From da6c1bba6385b2991119c22875598ea21214295c Mon Sep 17 00:00:00 2001 From: David Ralph Date: Wed, 17 Nov 2021 21:50:34 +0000 Subject: [PATCH] chore: comment out unfinished things --- src/components/modals/Modals.jsx | 4 ++-- .../sections/background/Background.jsx | 2 +- src/components/modals/main/tabs/Settings.jsx | 4 ++-- .../modals/main/tabs/backend/Tab.jsx | 4 ++-- .../widgets/background/Favourite.jsx | 4 ++-- src/components/widgets/background/Maximise.jsx | 4 ++-- .../widgets/background/PhotoInformation.jsx | 18 +++++++++--------- src/components/widgets/navbar/Notes.jsx | 6 +++--- .../widgets/quicklinks/QuickLinks.jsx | 4 ++-- src/components/widgets/quote/Quote.jsx | 8 ++++---- src/components/widgets/search/Search.jsx | 6 +++--- src/modules/helpers/background/widget.js | 4 ++-- src/modules/helpers/settings/index.js | 10 +++++----- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/components/modals/Modals.jsx b/src/components/modals/Modals.jsx index f093fcc0..42fd466e 100644 --- a/src/components/modals/Modals.jsx +++ b/src/components/modals/Modals.jsx @@ -1,7 +1,7 @@ import variables from 'modules/variables'; import { PureComponent, Suspense, lazy } from 'react'; import Modal from 'react-modal'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import Main from './main/Main'; import Navbar from '../widgets/navbar/Navbar'; @@ -89,7 +89,7 @@ export default class Modals extends PureComponent { {this.state.preview ? window.location.reload()}/> : null} - {variables.keybinds.toggleModal && variables.keybinds.toggleModal !== '' ? this.toggleModal('mainModal', (this.state.mainModal === true ? false : true))}/> : null} + {/*variables.keybinds.toggleModal && variables.keybinds.toggleModal !== '' ? this.toggleModal('mainModal', (this.state.mainModal === true ? false : true))}/> : null*/} ); } diff --git a/src/components/modals/main/settings/sections/background/Background.jsx b/src/components/modals/main/settings/sections/background/Background.jsx index 23d7a31e..f0896ed7 100644 --- a/src/components/modals/main/settings/sections/background/Background.jsx +++ b/src/components/modals/main/settings/sections/background/Background.jsx @@ -125,7 +125,7 @@ export default class BackgroundSettings extends PureComponent { - + {/**/}

{getMessage('modals.main.settings.sections.background.source.title')}

this.setState({ backgroundType: value })} category='background'> diff --git a/src/components/modals/main/tabs/Settings.jsx b/src/components/modals/main/tabs/Settings.jsx index ef054d04..d62e4302 100644 --- a/src/components/modals/main/tabs/Settings.jsx +++ b/src/components/modals/main/tabs/Settings.jsx @@ -15,7 +15,7 @@ import Order from '../settings/sections/Order'; import Appearance from '../settings/sections/Appearance'; import Language from '../settings/sections/Language'; import Advanced from '../settings/sections/Advanced'; -import Keybinds from '../settings/sections/Keybinds'; +//import Keybinds from '../settings/sections/Keybinds'; import Stats from '../settings/sections/Stats'; import Experimental from '../settings/sections/Experimental'; import Changelog from '../settings/sections/Changelog'; @@ -41,7 +41,7 @@ export default function Settings() {
-
+ {/*
*/}
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx index c949fd92..3279c0bd 100644 --- a/src/components/modals/main/tabs/backend/Tab.jsx +++ b/src/components/modals/main/tabs/backend/Tab.jsx @@ -20,7 +20,7 @@ import { Translate as Language, SettingsOutlined as Advanced, BugReportOutlined as Experimental, - KeyboardAltOutlined as Keybinds, + //KeyboardAltOutlined as Keybinds, AssessmentOutlined as Stats, NewReleasesOutlined as Changelog, InfoOutlined as About, @@ -66,7 +66,7 @@ function Tab({ label, currentTab, onClick, navbarTab }) { case getMessage('modals.main.settings.sections.appearance.title'): icon = ; break; case getMessage('modals.main.settings.sections.language.title'): icon = ; divider = true; break; case getMessage('modals.main.settings.sections.advanced.title'): icon = ; break; - case getMessage('modals.main.settings.sections.keybinds.title'): icon = ; break; + //case getMessage('modals.main.settings.sections.keybinds.title'): icon = ; break; case getMessage('modals.main.settings.sections.stats.title'): icon = ; break; case getMessage('modals.main.settings.sections.experimental.title'): icon = ; divider = true; break; case getMessage('modals.main.settings.sections.changelog.title'): icon = ; break; diff --git a/src/components/widgets/background/Favourite.jsx b/src/components/widgets/background/Favourite.jsx index 7e5eb727..03eb7eb5 100644 --- a/src/components/widgets/background/Favourite.jsx +++ b/src/components/widgets/background/Favourite.jsx @@ -1,7 +1,7 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { Star, StarBorder } from '@mui/icons-material'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import Tooltip from 'components/helpers/tooltip/Tooltip'; @@ -81,7 +81,7 @@ export default class Favourite extends PureComponent { return ( {this.state.favourited} - {variables.keybinds.favouriteBackground && variables.keybinds.favouriteBackground !== '' ? this.favourite()} /> : null} + {/*variables.keybinds.favouriteBackground && variables.keybinds.favouriteBackground !== '' ? this.favourite()} /> : null*/} ); } diff --git a/src/components/widgets/background/Maximise.jsx b/src/components/widgets/background/Maximise.jsx index 792d78fa..b8459103 100644 --- a/src/components/widgets/background/Maximise.jsx +++ b/src/components/widgets/background/Maximise.jsx @@ -1,7 +1,7 @@ import variables from 'modules/variables'; import { PureComponent } from 'react'; import { Fullscreen } from '@mui/icons-material'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import Tooltip from 'components/helpers/tooltip/Tooltip'; @@ -59,7 +59,7 @@ export default class Maximise extends PureComponent { return ( - {variables.keybinds.maximiseBackground && variables.keybinds.maximiseBackground !== '' ? : null} + {/*variables.keybinds.maximiseBackground && variables.keybinds.maximiseBackground !== '' ? : null*/} ); } diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx index b1f061f1..60719198 100644 --- a/src/components/widgets/background/PhotoInformation.jsx +++ b/src/components/widgets/background/PhotoInformation.jsx @@ -1,8 +1,8 @@ import variables from 'modules/variables'; import { useState, Fragment } from 'react'; import { Info, LocationOn, PhotoCamera, Crop as Resolution, Person as Photographer, GetApp as Download } from '@mui/icons-material'; -import Hotkeys from 'react-hot-keys'; -import { lat2tile, lon2tile } from 'modules/helpers/background/widget'; +//import Hotkeys from 'react-hot-keys'; +//import { lat2tile, lon2tile } from 'modules/helpers/background/widget'; const toDataURL = async (url) => { const res = await fetch(url); @@ -75,7 +75,7 @@ export default function PhotoInformation({ info, url, api }) { } const downloadEnabled = (localStorage.getItem('downloadbtn') === 'true') && !info.offline && !info.photographerURL && api; - const downloadBackground = () => { + /*const downloadBackground = () => { if (downloadEnabled) { downloadImage(info); } @@ -90,9 +90,9 @@ export default function PhotoInformation({ info, url, api }) { element.style.display = 'none'; } } - }; + };*/ - const photoMap = () => { + {/*const photoMap = () => { if (localStorage.getItem('photoMap') !== 'true' || !info.latitude || !info.longitude) { return null; } @@ -119,7 +119,7 @@ export default function PhotoInformation({ info, url, api }) { ); - } + }*/} return (
@@ -129,7 +129,7 @@ export default function PhotoInformation({ info, url, api }) {

{variables.language.getMessage(variables.languagecode, 'widgets.background.information')}


- {photoMap()} + {/*photoMap()*/} {/* fix console error by using fragment and key */} {info.location && info.location !== 'N/A' ? @@ -150,8 +150,8 @@ export default function PhotoInformation({ info, url, api }) { : null}
- {variables.keybinds.downloadBackground && variables.keybinds.downloadBackground !== '' ? downloadBackground()} /> : null} - {variables.keybinds.showBackgroundInformation && variables.keybinds.showBackgroundInformation !== '' ? showBackgroundInformation()} /> : null} + {/*variables.keybinds.downloadBackground && variables.keybinds.downloadBackground !== '' ? downloadBackground()} /> : null*/} + {/*variables.keybinds.showBackgroundInformation && variables.keybinds.showBackgroundInformation !== '' ? showBackgroundInformation()} /> : null*/} ); } diff --git a/src/components/widgets/navbar/Notes.jsx b/src/components/widgets/navbar/Notes.jsx index 9f2331ff..ce9c5a2e 100644 --- a/src/components/widgets/navbar/Notes.jsx +++ b/src/components/widgets/navbar/Notes.jsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { FileCopyRounded, AssignmentRounded as NotesRounded, PushPin } from '@mui/icons-material'; import TextareaAutosize from '@mui/material/TextareaAutosize'; import { toast } from 'react-toastify'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; export default class Notes extends PureComponent { constructor() { @@ -54,8 +54,8 @@ export default class Notes extends PureComponent { - {variables.keybinds.pinNotes && variables.keybinds.pinNotes !== '' ? this.pin()}/> : null} - {variables.keybinds.copyNotes && variables.keybinds.copyNotes !== '' ? this.copy()}/> : null} + {/*variables.keybinds.pinNotes && variables.keybinds.pinNotes !== '' ? this.pin()}/> : null*/} + {/*variables.keybinds.copyNotes && variables.keybinds.copyNotes !== '' ? this.copy()}/> : null*/} ); } diff --git a/src/components/widgets/quicklinks/QuickLinks.jsx b/src/components/widgets/quicklinks/QuickLinks.jsx index 540e7f31..587cd518 100644 --- a/src/components/widgets/quicklinks/QuickLinks.jsx +++ b/src/components/widgets/quicklinks/QuickLinks.jsx @@ -1,7 +1,7 @@ import variables from 'modules/variables'; import { PureComponent, createRef } from 'react'; import { TextareaAutosize } from '@mui/material'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import Tooltip from 'components/helpers/tooltip/Tooltip'; @@ -199,7 +199,7 @@ export default class QuickLinks extends PureComponent { - {variables.keybinds.toggleQuicklinks && variables.keybinds.toggleQuicklinks !== '' ? : null} + {/*variables.keybinds.toggleQuicklinks && variables.keybinds.toggleQuicklinks !== '' ? : null*/} ); } diff --git a/src/components/widgets/quote/Quote.jsx b/src/components/widgets/quote/Quote.jsx index 4e1fdaa2..e7f29aa2 100644 --- a/src/components/widgets/quote/Quote.jsx +++ b/src/components/widgets/quote/Quote.jsx @@ -2,7 +2,7 @@ import variables from 'modules/variables'; import { PureComponent, createRef } from 'react'; import { FilterNone as FileCopy, Twitter, Star, StarBorder } from '@mui/icons-material'; import { toast } from 'react-toastify'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import Interval from 'modules/helpers/interval'; import EventBus from 'modules/helpers/eventbus'; @@ -277,9 +277,9 @@ export default class Quote extends PureComponent {
{this.state.copy} {this.state.tweet} {this.state.favourited} - {variables.keybinds.favouriteQuote && variables.keybinds.favouriteQuote !== '' ? this.favourite()} /> : null} - {variables.keybinds.tweetQuote && variables.keybinds.tweetQuote !== '' ? this.tweetQuote()} /> : null} - {variables.keybinds.copyQuote && variables.keybinds.copyQuote !== '' ? this.copyQuote()} /> : null} + {/*variables.keybinds.favouriteQuote && variables.keybinds.favouriteQuote !== '' ? this.favourite()} /> : null*/} + {/*variables.keybinds.tweetQuote && variables.keybinds.tweetQuote !== '' ? this.tweetQuote()} /> : null*/} + {/*variables.keybinds.copyQuote && variables.keybinds.copyQuote !== '' ? this.copyQuote()} /> : null*/} ); } diff --git a/src/components/widgets/search/Search.jsx b/src/components/widgets/search/Search.jsx index a0216825..756b9275 100644 --- a/src/components/widgets/search/Search.jsx +++ b/src/components/widgets/search/Search.jsx @@ -1,7 +1,7 @@ import variables from 'modules/variables'; import { PureComponent, Fragment } from 'react'; import { Search as SearchIcon, Mic } from '@mui/icons-material'; -import Hotkeys from 'react-hot-keys'; +//import Hotkeys from 'react-hot-keys'; import AutocompleteInput from 'components/helpers/autocomplete/Autocomplete'; @@ -178,7 +178,7 @@ export default class Search extends PureComponent {
{searchEngines.map(({ name }) => { if (name === this.state.currentSearch) { - return null; + return null; } return ( @@ -193,7 +193,7 @@ export default class Search extends PureComponent { {this.state.microphone} this.getSuggestions(e)} onClick={this.searchButton}/> - {variables.keybinds.focusSearch && variables.keybinds.focusSearch !== '' ? document.getElementById('searchtext').focus()}/> : null} + {/*variables.keybinds.focusSearch && variables.keybinds.focusSearch !== '' ? document.getElementById('searchtext').focus()}/> : null*/} ); diff --git a/src/modules/helpers/background/widget.js b/src/modules/helpers/background/widget.js index 8e27e57d..046a437e 100644 --- a/src/modules/helpers/background/widget.js +++ b/src/modules/helpers/background/widget.js @@ -74,10 +74,10 @@ export function randomColourStyleBuilder(type) { } // source: https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#ECMAScript_.28JavaScript.2FActionScript.2C_etc..29 -export function lon2tile(lon, zoom) { +/*export function lon2tile(lon, zoom) { return (Math.floor((lon + 180) / 360 * Math.pow(2, zoom))); } export function lat2tile(lat, zoom) { return (Math.floor((1 - Math.log(Math.tan(lat * Math.PI / 180) + 1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, zoom))); -} +}*/ diff --git a/src/modules/helpers/settings/index.js b/src/modules/helpers/settings/index.js index 6354e842..e5b15582 100644 --- a/src/modules/helpers/settings/index.js +++ b/src/modules/helpers/settings/index.js @@ -135,11 +135,11 @@ export function loadSettings(hotreload) { console.log(` █████████████████████████████████████████████████████████████ ██ ██ -██ ███ ███ ██ ██ ███████ ██ -██ ████ ████ ██ ██ ██ ██ -██ ██ ████ ██ ██ ██ █████ ██ -██ ██ ██ ██ ██ ██ ██ ██ -██ ██ ██ ██████ ███████ ██ +██ ███ ███ ██ ██ ███████ ██ +██ ████ ████ ██ ██ ██ ██ +██ ██ ████ ██ ██ ██ █████ ██ +██ ██ ██ ██ ██ ██ ██ ██ +██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ ██ Copyright 2018-${new Date().getFullYear()} The Mue Authors ██