From 003bf2400a2b42b218f8e0156e7fcdde01fac0fe Mon Sep 17 00:00:00 2001 From: alexsparkes Date: Tue, 21 May 2024 20:51:33 +0100 Subject: [PATCH] chore: run prettier Co-authored-by: Isaac --- .../MainModal/scss/marketplace/_main.scss | 7 +- .../scss/modules/_modalTabContent.scss | 5 +- .../MainModal/scss/modules/_scrollbars.scss | 2 +- .../Elements/ResetModal/ResetModal.jsx | 14 +++- src/components/Elements/Tooltip/tooltip.scss | 2 +- src/components/Layout/Settings/index.jsx | 2 +- .../components/PhotoInformation.jsx | 2 +- src/features/background/options/Colour.jsx | 12 +-- .../options/optionTypes/APIQualityOptions.js | 2 +- .../optionTypes/backgroundImageEffects.js | 59 +++++++------- .../optionTypes/getBackgroundOptionItems.js | 55 +++++++------ .../background/options/optionTypes/index.js | 2 +- .../greeting/options/GreetingOptions.jsx | 12 ++- .../components/Elements/Carousel/Carousel.jsx | 5 +- .../SideloadFailedModal.jsx | 5 +- .../marketplace/components/Items/Items.jsx | 3 +- src/features/marketplace/views/Added.jsx | 10 ++- src/features/marketplace/views/ItemPage.jsx | 12 ++- src/features/misc/sections/Overview.jsx | 1 - src/features/navbar/components/Todo.jsx | 6 +- src/features/navbar/options/NavbarOptions.jsx | 16 ++-- src/features/quote/Quote.jsx | 20 +++-- src/features/quote/quote.scss | 3 +- src/features/search/Search.jsx | 79 +++++++++---------- src/features/stats/options/StatsOptions.jsx | 4 +- src/features/time/options/DateOptions.jsx | 7 +- src/features/weather/Weather.jsx | 2 - src/features/weather/api/getWeather.js | 7 +- .../weather/components/WeatherSkeleton.jsx | 48 +++++------ src/i18n/locales/en_GB.json | 4 +- src/scss/_toast.scss | 1 - src/scss/index.scss | 4 +- 32 files changed, 229 insertions(+), 184 deletions(-) diff --git a/src/components/Elements/MainModal/scss/marketplace/_main.scss b/src/components/Elements/MainModal/scss/marketplace/_main.scss index 6e0a28c4..37d83f30 100644 --- a/src/components/Elements/MainModal/scss/marketplace/_main.scss +++ b/src/components/Elements/MainModal/scss/marketplace/_main.scss @@ -5,9 +5,9 @@ @import 'scss/variables'; .creatorItems { - .item { - flex-flow: row !important; - } + .item { + flex-flow: row !important; + } .item-back { margin: 0 !important; filter: blur(40px) saturate(180%) brightness(90%) !important; @@ -482,7 +482,6 @@ p.author { cursor: pointer; text-decoration: underline; } - } .createYourOwn { diff --git a/src/components/Elements/MainModal/scss/modules/_modalTabContent.scss b/src/components/Elements/MainModal/scss/modules/_modalTabContent.scss index 8f8a71f9..dbd7a8a9 100644 --- a/src/components/Elements/MainModal/scss/modules/_modalTabContent.scss +++ b/src/components/Elements/MainModal/scss/modules/_modalTabContent.scss @@ -69,8 +69,8 @@ .resetDataButtonsLayout { display: grid; grid-template-columns: 1fr 1fr; - grid-gap: 20px; - + grid-gap: 20px; + :nth-child(1) { grid-column: span 2; } @@ -81,7 +81,6 @@ } } - table { border-collapse: separate; diff --git a/src/components/Elements/MainModal/scss/modules/_scrollbars.scss b/src/components/Elements/MainModal/scss/modules/_scrollbars.scss index d359a294..fbf774b3 100644 --- a/src/components/Elements/MainModal/scss/modules/_scrollbars.scss +++ b/src/components/Elements/MainModal/scss/modules/_scrollbars.scss @@ -28,4 +28,4 @@ background: t($btn-backgroundHover); } } -} \ No newline at end of file +} diff --git a/src/components/Elements/ResetModal/ResetModal.jsx b/src/components/Elements/ResetModal/ResetModal.jsx index 923c67f0..bdeeb816 100644 --- a/src/components/Elements/ResetModal/ResetModal.jsx +++ b/src/components/Elements/ResetModal/ResetModal.jsx @@ -32,8 +32,18 @@ function ResetModal({ modalClose }) { {variables.getMessage('modals.main.settings.sections.advanced.reset_modal.information')}
-
); diff --git a/src/components/Elements/Tooltip/tooltip.scss b/src/components/Elements/Tooltip/tooltip.scss index 1c834cd2..03db880d 100644 --- a/src/components/Elements/Tooltip/tooltip.scss +++ b/src/components/Elements/Tooltip/tooltip.scss @@ -124,4 +124,4 @@ #floating[data-status='initial'][data-placement^='right'], #floating[data-status='close'][data-placement^='right'] { transform: translateX(-5px); -} \ No newline at end of file +} diff --git a/src/components/Layout/Settings/index.jsx b/src/components/Layout/Settings/index.jsx index f56c0274..ffb7a6ed 100644 --- a/src/components/Layout/Settings/index.jsx +++ b/src/components/Layout/Settings/index.jsx @@ -1,4 +1,4 @@ export * from './Header'; export * from './PreferencesWrapper'; export * from './Section'; -export * from './Item'; \ No newline at end of file +export * from './Item'; diff --git a/src/features/background/components/PhotoInformation.jsx b/src/features/background/components/PhotoInformation.jsx index 3984a667..5ae7e9a7 100644 --- a/src/features/background/components/PhotoInformation.jsx +++ b/src/features/background/components/PhotoInformation.jsx @@ -216,7 +216,7 @@ function PhotoInformation({ info, url, api }) { downloadImage(info)} /> )} - {(info.pun && info.category) && ( + {info.pun && info.category && ( { - const [colour, setColour] = useState(localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 0)'); + const [colour, setColour] = useState( + localStorage.getItem('customBackgroundColour') || 'rgba(0, 0, 0, 0)', + ); const changeColour = (output) => { setColour(output); localStorage.setItem('customBackgroundColour', output); showReminder(); - } + }; const resetColour = () => { setColour('rgba(0, 0, 0, 0)'); localStorage.setItem('customBackgroundColour', 'rgba(0, 0, 0, 0)'); toast(variables.getMessage('toasts.reset')); showReminder(); - } + }; const showReminder = () => { const reminderInfo = document.querySelector('.reminder-info'); @@ -29,7 +31,7 @@ const ColourOptions = () => { reminderInfo.style.display = 'block'; localStorage.setItem('showReminder', true); } - } + }; return ( @@ -39,7 +41,7 @@ const ColourOptions = () => { )} /> - { ); const [enableBirthday, setEnableBirthday] = useState( - localStorage.getItem('birthdayenabled') === 'true' ? 'preferences' : 'preferencesInactive' + localStorage.getItem('birthdayenabled') === 'true' ? 'preferences' : 'preferencesInactive', ); const [enableCustomEvents, setEnableCustomEvents] = useState( - localStorage.getItem('events') === 'true' ? 'preferences' : 'preferencesInactive' + localStorage.getItem('events') === 'true' ? 'preferences' : 'preferencesInactive', ); const changeDate = (e) => { @@ -139,7 +139,9 @@ const GreetingOptions = () => { name="birthdayenabled" text={variables.getMessage('modals.main.settings.enabled')} category="greeting" - onChange={(value) => { setEnableBirthday(value ? 'preferences' : 'preferencesInactive'); }} + onChange={(value) => { + setEnableBirthday(value ? 'preferences' : 'preferencesInactive'); + }} />
{ name="events" text={variables.getMessage(`${GREETING_SECTION}.events`)} category="greeting" - onChange={(value) => { setEnableCustomEvents(value ? 'preferences' : 'preferencesInactive'); }} + onChange={(value) => { + setEnableCustomEvents(value ? 'preferences' : 'preferencesInactive'); + }} /> diff --git a/src/features/marketplace/components/Elements/Carousel/Carousel.jsx b/src/features/marketplace/components/Elements/Carousel/Carousel.jsx index 59715b08..9302dd17 100644 --- a/src/features/marketplace/components/Elements/Carousel/Carousel.jsx +++ b/src/features/marketplace/components/Elements/Carousel/Carousel.jsx @@ -53,10 +53,7 @@ function EmblaCarousel({ data }) { {data?.slice(0, 5).map((photo, index) => (
- Marketplace example screenshot + Marketplace example screenshot
))} diff --git a/src/features/marketplace/components/Elements/SideloadFailedModal/SideloadFailedModal.jsx b/src/features/marketplace/components/Elements/SideloadFailedModal/SideloadFailedModal.jsx index cfc1395f..c6e0de37 100644 --- a/src/features/marketplace/components/Elements/SideloadFailedModal/SideloadFailedModal.jsx +++ b/src/features/marketplace/components/Elements/SideloadFailedModal/SideloadFailedModal.jsx @@ -23,4 +23,7 @@ function SideloadFailedModal({ modalClose, reason }) { } const MemoizedSideloadFailedModal = memo(SideloadFailedModal); -export { MemoizedSideloadFailedModal as default, MemoizedSideloadFailedModal as SideloadFailedModal }; +export { + MemoizedSideloadFailedModal as default, + MemoizedSideloadFailedModal as SideloadFailedModal, +}; diff --git a/src/features/marketplace/components/Items/Items.jsx b/src/features/marketplace/components/Items/Items.jsx index 0c362e27..2b781184 100644 --- a/src/features/marketplace/components/Items/Items.jsx +++ b/src/features/marketplace/components/Items/Items.jsx @@ -73,7 +73,8 @@ function Items({ }) { const shouldShowCollection = ((collection && !onCollection && (filter === null || filter === '')) || - (type === 'collections' && !onCollection && (filter === null || filter === ''))) && type !== 'preset_settings'; + (type === 'collections' && !onCollection && (filter === null || filter === ''))) && + type !== 'preset_settings'; return ( <> diff --git a/src/features/marketplace/views/Added.jsx b/src/features/marketplace/views/Added.jsx index 66a01e7c..bd34c4b7 100644 --- a/src/features/marketplace/views/Added.jsx +++ b/src/features/marketplace/views/Added.jsx @@ -193,8 +193,7 @@ export default class Added extends PureComponent { this.state.installed.forEach((item) => { uninstall(item.type, item.name); }); - } catch (e) { - } + } catch (e) {} localStorage.setItem('installed', JSON.stringify([])); @@ -281,7 +280,12 @@ export default class Added extends PureComponent { icon={} label={variables.getMessage('modals.main.addons.check_updates')} /> - - )); + , + ); } setURL(_url); @@ -86,7 +88,6 @@ function Search() { setCurrentSearch(info ? info.name : 'Custom'); } - function startSpeechRecognition() { const voiceSearch = new window.webkitSpeechRecognition(); voiceSearch.start(); @@ -110,15 +111,14 @@ function Search() { window.location.href = url + `?${query}=` + searchText.value; }, 1000); }; - }; + } function searchButton(e) { e.preventDefault(); const value = e.target.value || document.getElementById('searchtext').value || 'mue fast'; variables.stats.postEvent('feature', 'Search'); window.location.href = url + `?${query}=` + value; - }; - + } async function getSuggestions(input) { if (input === '') { @@ -126,12 +126,14 @@ function Search() { return; } - const results = await (await fetch(`${variables.constants.API_URL}/search/autocomplete?q=${input}`)).json(); + const results = await ( + await fetch(`${variables.constants.API_URL}/search/autocomplete?q=${input}`) + ).json(); try { setSuggestions(results.suggestions.splice(0, 5)); } catch (e) { - console.error(e) + console.error(e); // ignore error if empty } } @@ -174,7 +176,6 @@ function Search() { setSearchDropdown(false); } - /** * Gets the icon for the search engine dropdown. * @param {string} name - The name of the search engine. @@ -245,39 +246,37 @@ function Search() {
- {localStorage.getItem('searchDropdown') === 'true' && - searchDropdown === true && ( -
- {searchEngines.map(({ name }, key) => { - return ( - setSearch(name)} - key={key} - > - {name} - - ); - })} - setSearch(customText, 'custom')} - > - {customText} - -
- )} + {localStorage.getItem('searchDropdown') === 'true' && searchDropdown === true && ( +
+ {searchEngines.map(({ name }, key) => { + return ( + setSearch(name)} + key={key} + > + {name} + + ); + })} + setSearch(customText, 'custom')} + > + {customText} + +
+ )}
); } - const MemoizedSearch = memo(Search); export { MemoizedSearch as default, MemoizedSearch as Search }; diff --git a/src/features/stats/options/StatsOptions.jsx b/src/features/stats/options/StatsOptions.jsx index 3efe0e5b..5b695acf 100644 --- a/src/features/stats/options/StatsOptions.jsx +++ b/src/features/stats/options/StatsOptions.jsx @@ -166,7 +166,9 @@ class Stats extends PureComponent { )} {statsElement( variables.getMessage(`${STATS_SECTION}.sections.addons_installed`), - this.state.stats.marketplace && this.state.stats.marketplace['install'] ? this.state.stats.marketplace['install'].length : 0, + this.state.stats.marketplace && this.state.stats.marketplace['install'] + ? this.state.stats.marketplace['install'].length + : 0, )} diff --git a/src/features/time/options/DateOptions.jsx b/src/features/time/options/DateOptions.jsx index e185fe53..fe28c0a3 100644 --- a/src/features/time/options/DateOptions.jsx +++ b/src/features/time/options/DateOptions.jsx @@ -88,7 +88,12 @@ function DateOptions() { zoomSetting="zoomDate" visibilityToggle={true} /> - + { }, done: true, }; - localStorage.setItem('currentWeather', JSON.stringify({ data: cacheable, cachedAt: Date.now() })); - return cacheable + localStorage.setItem( + 'currentWeather', + JSON.stringify({ data: cacheable, cachedAt: Date.now() }), + ); + return cacheable; } catch (error) { console.error('Fetch Error: ', error); } diff --git a/src/features/weather/components/WeatherSkeleton.jsx b/src/features/weather/components/WeatherSkeleton.jsx index 713eeac9..c0c269fa 100644 --- a/src/features/weather/components/WeatherSkeleton.jsx +++ b/src/features/weather/components/WeatherSkeleton.jsx @@ -10,40 +10,40 @@ function WeatherSkeleton({ weatherType }) { 20C {weatherType >= 2 && ( - - min - max - + + min + max + )} {weatherType >= 2 && ( -
- feels like x - location -
+
+ feels like x + location +
)} {weatherType >= 3 && ( -
- extra information -
-
-
- location -
-
-
- location -
-
-
- location +
+ extra information +
+
+
+ location +
+
+
+ location +
+
+
+ location +
-
)}
); } -export default memo(WeatherSkeleton); \ No newline at end of file +export default memo(WeatherSkeleton); diff --git a/src/i18n/locales/en_GB.json b/src/i18n/locales/en_GB.json index 97cf8312..dcfae1c0 100644 --- a/src/i18n/locales/en_GB.json +++ b/src/i18n/locales/en_GB.json @@ -441,8 +441,8 @@ }, "experimental_warning": "Please note that the Mue team cannot provide support if you have experimental mode on. Please disable it first and see if the issue continues to occur before contacting support.", "preview_data_disabled": { - "title":"Data Settings Disabled", - "description":"Data settings are disabled in preview mode. Please exit preview mode to use this feature." + "title": "Data Settings Disabled", + "description": "Data settings are disabled in preview mode. Please exit preview mode to use this feature." } }, "stats": { diff --git a/src/scss/_toast.scss b/src/scss/_toast.scss index 00a6361f..06236134 100644 --- a/src/scss/_toast.scss +++ b/src/scss/_toast.scss @@ -36,4 +36,3 @@ .Toastify__toast--success { @extend %basic; } - diff --git a/src/scss/index.scss b/src/scss/index.scss index fc5fc879..343f834d 100644 --- a/src/scss/index.scss +++ b/src/scss/index.scss @@ -203,8 +203,6 @@ body { } } - - // credit to Kendrick Arnett https://codepen.io/kendrick/pen/WxNwdE .light { .pulse { @@ -240,4 +238,4 @@ body { } } } -} \ No newline at end of file +}