style: codacy

This commit is contained in:
David Ralph
2021-04-16 12:26:56 +01:00
parent fe4d17eff3
commit 1ac6f418bf
11 changed files with 16 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
module.exports = { module.exports = {
extends: 'react-app', extends: 'react-app',
parser: '@babel/eslint-parser' parser: '@babel/eslint-parser'
} };

View File

@@ -29,14 +29,14 @@ export default class Added extends React.PureComponent {
}; };
this.buttons = { this.buttons = {
uninstall: <button className='removeFromMue' onClick={() => this.uninstall()}>{window.language.modals.main.marketplace.product.buttons.remove}</button>, uninstall: <button className='removeFromMue' onClick={() => this.uninstall()}>{window.language.modals.main.marketplace.product.buttons.remove}</button>,
} };
this.language = window.language.modals.main.addons; this.language = window.language.modals.main.addons;
} }
toggle(type, data) { toggle(type, data) {
if (type === 'item') { if (type === 'item') {
const installed = JSON.parse(localStorage.getItem('installed')); const installed = JSON.parse(localStorage.getItem('installed'));
const info = installed.find(i => i.name === data); const info = installed.find((i) => i.name === data);
this.setState({ this.setState({
item: { item: {

View File

@@ -34,7 +34,7 @@ export default class Marketplace extends React.PureComponent {
this.buttons = { this.buttons = {
uninstall: <button className='removeFromMue' onClick={() => this.manage('uninstall')}>{window.language.modals.main.marketplace.product.buttons.remove}</button>, uninstall: <button className='removeFromMue' onClick={() => this.manage('uninstall')}>{window.language.modals.main.marketplace.product.buttons.remove}</button>,
install: <button className='addToMue' onClick={() => this.manage('install')}>{window.language.modals.main.marketplace.product.buttons.addtomue}</button> install: <button className='addToMue' onClick={() => this.manage('install')}>{window.language.modals.main.marketplace.product.buttons.addtomue}</button>
} };
this.language = window.language.modals.main.marketplace; this.language = window.language.modals.main.marketplace;
} }

View File

@@ -10,7 +10,7 @@ export default function Sideload() {
const install = (input) => { const install = (input) => {
MarketplaceFunctions.install(input.type, input); MarketplaceFunctions.install(input.type, input);
toast(window.language.toasts.installed); toast(window.language.toasts.installed);
} };
return ( return (
<> <>

View File

@@ -57,7 +57,7 @@ export default class BackgroundSettings extends React.PureComponent {
<Checkbox name='backgroundVideoLoop' text={this.language.sections.background.source.loop_video}/> <Checkbox name='backgroundVideoLoop' text={this.language.sections.background.source.loop_video}/>
<Checkbox name='backgroundVideoMute' text={this.language.sections.background.source.mute_video}/> <Checkbox name='backgroundVideoMute' text={this.language.sections.background.source.mute_video}/>
</> </>
) );
} else { } else {
return null; return null;
} }
@@ -65,7 +65,7 @@ export default class BackgroundSettings extends React.PureComponent {
marketplaceType = () => { marketplaceType = () => {
if (localStorage.getItem('photo_packs')) { if (localStorage.getItem('photo_packs')) {
return <option value='photo_pack'>{window.language.modals.main.navbar.marketplace}</option> return <option value='photo_pack'>{window.language.modals.main.navbar.marketplace}</option>;
} }
} }

View File

@@ -26,7 +26,7 @@ export default class Background extends React.PureComponent {
if (gradient.length > 1) { if (gradient.length > 1) {
// Note: Append the gradient for additional browser support. // Note: Append the gradient for additional browser support.
const stepStyles = gradient.map(g => ` ${g.colour} ${g.stop}%`).join(); const stepStyles = gradient.map((g) => ` ${g.colour} ${g.stop}%`).join();
style += ` background: ${type}-gradient(${(type === 'linear' ? (`${angle}deg,`) : '')}${stepStyles})`; style += ` background: ${type}-gradient(${(type === 'linear' ? (`${angle}deg,`) : '')}${stepStyles})`;
} }
@@ -37,7 +37,7 @@ export default class Background extends React.PureComponent {
} }
videoCheck(url) { videoCheck(url) {
return url.startsWith('data:video/') || url.endsWith('.mp4') || url.endsWith('.webm') || url.endsWith('.ogg') return url.startsWith('data:video/') || url.endsWith('.mp4') || url.endsWith('.webm') || url.endsWith('.ogg');
} }
offlineBackground() { offlineBackground() {
@@ -235,7 +235,7 @@ export default class Background extends React.PureComponent {
} }
}); });
this.getBackground(); this.getBackground();
} };
EventBus.on('refresh', (data) => { EventBus.on('refresh', (data) => {
if (data === 'background') { if (data === 'background') {

View File

@@ -34,7 +34,7 @@ export default class Search extends React.PureComponent {
setTimeout(() => { setTimeout(() => {
window.location.href = this.state.url + `?${this.state.query}=` + searchText.value; window.location.href = this.state.url + `?${this.state.query}=` + searchText.value;
}, 1000); }, 1000);
} };
} }
searchButton = () => { searchButton = () => {

View File

@@ -115,7 +115,7 @@ export default class Weather extends React.PureComponent {
return (<div className='weather'> return (<div className='weather'>
<span className='loc'>{this.state.location}</span> <span className='loc'>{this.state.location}</span>
</div>); </div>);
}; }
const minmax = () => { const minmax = () => {
const mintemp = (localStorage.getItem('mintemp') === 'true'); const mintemp = (localStorage.getItem('mintemp') === 'true');

View File

@@ -1,6 +1,6 @@
const isValidRGBValue = (value) => { const isValidRGBValue = (value) => {
return (typeof (value) === 'number' && Number.isNaN(value) === false && value >= 0 && value <= 255); return (typeof (value) === 'number' && Number.isNaN(value) === false && value >= 0 && value <= 255);
} };
export default function setRGBA(red, green, blue, alpha) { export default function setRGBA(red, green, blue, alpha) {
if (isValidRGBValue(red) && isValidRGBValue(green) && isValidRGBValue(blue)) { if (isValidRGBValue(red) && isValidRGBValue(green) && isValidRGBValue(blue)) {

View File

@@ -14,7 +14,7 @@ export default class MarketplaceFunctions {
case 'settings': case 'settings':
const oldSettings = JSON.parse(localStorage.getItem('backup_settings')); const oldSettings = JSON.parse(localStorage.getItem('backup_settings'));
localStorage.clear(); localStorage.clear();
oldSettings.forEach(item => localStorage.setItem(item.name, item.value)); oldSettings.forEach((item) => localStorage.setItem(item.name, item.value));
break; break;
case 'quote_packs': case 'quote_packs':
localStorage.removeItem('quote_packs'); localStorage.removeItem('quote_packs');
@@ -60,7 +60,7 @@ export default class MarketplaceFunctions {
} }
localStorage.setItem('backup_settings', JSON.stringify(oldSettings)); localStorage.setItem('backup_settings', JSON.stringify(oldSettings));
input.settings.forEach(element => localStorage.setItem(element.name, element.value)); input.settings.forEach((element) => localStorage.setItem(element.name, element.value));
break; break;
case 'photos': case 'photos':

View File

@@ -73,7 +73,7 @@
"title": "Digital", "title": "Digital",
"seconds": "Sekunden", "seconds": "Sekunden",
"twentyfourhour": "24 Stunden", "twentyfourhour": "24 Stunden",
"twelvehour": "12 hour", "twelvehour": "12 Stunden",
"zero": "Nullen füllen" "zero": "Nullen füllen"
}, },
"analogue": { "analogue": {