props.toggleFunction(item.name)} key={item.name}>
+ {items.map((item) => (
+
toggleFunction(item.name)} key={item.name}>
{item.display_name || item.name}
diff --git a/src/components/modals/main/marketplace/Lightbox.jsx b/src/components/modals/main/marketplace/Lightbox.jsx
index 1a552e1f..884fb981 100644
--- a/src/components/modals/main/marketplace/Lightbox.jsx
+++ b/src/components/modals/main/marketplace/Lightbox.jsx
@@ -1,10 +1,10 @@
-export default function Lightbox(props) {
+export default function Lightbox({ modalClose, img }) {
window.stats.postEvent('modal', 'Opened lightbox');
return (
<>
-
×
-

+
×
+

>
);
}
diff --git a/src/components/modals/main/settings/ResetModal.jsx b/src/components/modals/main/settings/ResetModal.jsx
index 22d8a971..f679d96d 100644
--- a/src/components/modals/main/settings/ResetModal.jsx
+++ b/src/components/modals/main/settings/ResetModal.jsx
@@ -1,7 +1,7 @@
import { Close, Delete } from '@material-ui/icons';
import { setDefaultSettings } from 'modules/helpers/settings';
-export default function ResetModal(props) {
+export default function ResetModal({ modalClose }) {
const language = window.language.modals.main.settings.sections.advanced.reset_modal;
const reset = () => {
@@ -20,7 +20,7 @@ export default function ResetModal(props) {
-
diff --git a/src/components/modals/main/settings/sections/About.jsx b/src/components/modals/main/settings/sections/About.jsx
index 15140407..b2cca64f 100644
--- a/src/components/modals/main/settings/sections/About.jsx
+++ b/src/components/modals/main/settings/sections/About.jsx
@@ -25,10 +25,8 @@ export default class About extends PureComponent {
try {
versionData = await (await fetch(window.constants.GITHUB_URL + '/repos/' + window.constants.ORG_NAME + '/' + window.constants.REPO_NAME + '/releases', { signal: this.controller.signal })).json();
-
contributors = await (await fetch(window.constants.GITHUB_URL + '/repos/'+ window.constants.ORG_NAME + '/' + window.constants.REPO_NAME + '/contributors', { signal: this.controller.signal })).json();
sponsors = (await (await fetch(window.constants.SPONSORS_URL + '/list', { signal: this.controller.signal })).json()).sponsors;
-
photographers = await (await fetch(window.constants.API_URL + '/images/photographers', { signal: this.controller.signal })).json();
} catch (e) {
if (this.controller.signal.aborted === true) {
diff --git a/src/components/modals/main/tabs/backend/Tab.jsx b/src/components/modals/main/tabs/backend/Tab.jsx
index 254962b6..dad6632e 100644
--- a/src/components/modals/main/tabs/backend/Tab.jsx
+++ b/src/components/modals/main/tabs/backend/Tab.jsx
@@ -24,15 +24,15 @@ import {
KeyboardAltOutlined as Keybinds
} from '@material-ui/icons';
-function Tab(props) {
+function Tab({ currentTab, label, navbarTab, onClick }) {
let className = 'tab-list-item';
- if (props.currentTab === props.label) {
+ if (currentTab === label) {
className += ' tab-list-active';
}
- if (props.navbar === true) {
+ if (navbarTab === true) {
className = 'navbar-item';
- if (props.currentTab === props.label) {
+ if (currentTab === label) {
className += ' navbar-item-active';
}
}
@@ -41,7 +41,7 @@ function Tab(props) {
const { navbar, marketplace, addons } = window.language.modals.main;
let icon, divider;
- switch (props.label) {
+ switch (label) {
case navbar.settings: icon =
; break;
case navbar.addons: icon =
; break;
case navbar.marketplace: icon =
; break;
@@ -74,7 +74,7 @@ function Tab(props) {
default: break;
}
- if (props.label === settings.experimental.title) {
+ if (label === settings.experimental.title) {
if (localStorage.getItem('experimental') === 'false') {
return
;
}
@@ -82,8 +82,8 @@ function Tab(props) {
return (
<>
-
props.onClick(props.label)}>
- {icon} {props.label}
+ onClick(label)}>
+ {icon} {label}
{(divider === true) ?
: null}
>
diff --git a/src/components/modals/welcome/ProgressBar.jsx b/src/components/modals/welcome/ProgressBar.jsx
index f3af3991..52d0c018 100644
--- a/src/components/modals/welcome/ProgressBar.jsx
+++ b/src/components/modals/welcome/ProgressBar.jsx
@@ -1,15 +1,15 @@
-export default function ProgressBar(props) {
+export default function ProgressBar({ count, currentTab, switchTab }) {
return (
- {props.count.map((num) => {
+ {count.map((num) => {
let className = 'step';
- const index = props.count.indexOf(num);
- if (index === props.currentTab) {
+ const index = count.indexOf(num);
+ if (index === currentTab) {
className = 'step active';
}
- return
props.switchTab(index)}>
;
+ return
switchTab(index)}>
;
})}
);
diff --git a/src/components/widgets/background/PhotoInformation.jsx b/src/components/widgets/background/PhotoInformation.jsx
index 9eb0f78c..1a5f7cd6 100644
--- a/src/components/widgets/background/PhotoInformation.jsx
+++ b/src/components/widgets/background/PhotoInformation.jsx
@@ -21,30 +21,30 @@ const downloadImage = async (info) => {
window.stats.postEvent('feature', 'Background download');
};
-export default function PhotoInformation(props) {
+export default function PhotoInformation({ info, url, api }) {
const [width, setWidth] = useState(0);
const [height, setHeight] = useState(0);
const language = window.language.widgets.background;
- if (props.info.hidden === true || !props.info.credit) {
+ if (info.hidden === true || !info.credit) {
return null;
}
// remove unsplash and pexels text
- const photographer = props.info.credit.split(` ${language.unsplash}`)[0].split(` ${language.pexels}`);
+ const photographer = info.credit.split(` ${language.unsplash}`)[0].split(` ${language.pexels}`);
- let credit = props.info.credit;
+ let credit = info.credit;
let photo = language.credit;
// unsplash and pexels credit
- if (props.info.photographerURL && props.info.photographerURL !== '' && !props.info.offline && props.api) {
- if (props.api === 'unsplash') {
- photo =
{language.credit};
- credit = <>
{photographer} {language.unsplash}>;
+ if (info.photographerURL && info.photographerURL !== '' && !info.offline && api) {
+ if (api === 'unsplash') {
+ photo =
{language.credit};
+ credit = <>
{photographer} {language.unsplash}>;
} else {
- photo =
{language.credit};
- credit = <>
{photographer} {language.pexels}>;
+ photo =
{language.credit};
+ credit = <>
{photographer} {language.pexels}>;
}
}
@@ -54,7 +54,7 @@ export default function PhotoInformation(props) {
setWidth(event.target.width);
setHeight(event.target.height);
};
- img.src = (localStorage.getItem('ddgProxy') === 'true' && !props.info.offline && !props.url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + props.url : props.url;
+ img.src = (localStorage.getItem('ddgProxy') === 'true' && !info.offline && !url.startsWith('data:')) ? window.constants.DDG_IMAGE_PROXY + url : url;
// info is still there because we want the favourite button to work
if (localStorage.getItem('photoInformation') === 'false') {
@@ -62,18 +62,18 @@ export default function PhotoInformation(props) {
{photo} {credit}
- {props.info.location || 'N/A'}
- {props.info.camera || 'N/A'}
+ {info.location || 'N/A'}
+ {info.camera || 'N/A'}
{width}x{height}
);
}
- const downloadEnabled = (localStorage.getItem('downloadbtn') === 'true') && !props.info.offline && !props.info.photographerURL;
+ const downloadEnabled = (localStorage.getItem('downloadbtn') === 'true') && !info.offline && !info.photographerURL;
const downloadBackground = () => {
if (downloadEnabled) {
- downloadImage(props.info);
+ downloadImage(info);
}
};
@@ -97,13 +97,13 @@ export default function PhotoInformation(props) {
{language.information}
{/* fix console error by using fragment and key */}
- {props.info.location && props.info.location !== 'N/A' ?
+ {info.location && info.location !== 'N/A' ?
- {props.info.location}
+ {info.location}
: null}
- {props.info.camera && props.info.camera !== 'N/A' ?
+ {info.camera && info.camera !== 'N/A' ?
- {props.info.camera}
+ {info.camera}
: null}
{width}x{height}
@@ -112,7 +112,7 @@ export default function PhotoInformation(props) {
{downloadEnabled ?
<>
- downloadImage(props.info)}>{language.download}
+ downloadImage(info)}>{language.download}
>
: null}
diff --git a/src/components/widgets/search/search.scss b/src/components/widgets/search/search.scss
index 2a06a7c3..fdc8ab97 100644
--- a/src/components/widgets/search/search.scss
+++ b/src/components/widgets/search/search.scss
@@ -53,10 +53,7 @@
display: inline-block;
margin-top: 10px;
font-size: calc(5px + 1.2vmin);
-
- .searchSelected {
- cursor: pointer;
- }
+ user-select: none;
.searchDropdownList {
cursor: pointer;
diff --git a/src/components/widgets/weather/WeatherIcon.jsx b/src/components/widgets/weather/WeatherIcon.jsx
index 8f9e5fc9..1c675f8e 100644
--- a/src/components/widgets/weather/WeatherIcon.jsx
+++ b/src/components/widgets/weather/WeatherIcon.jsx
@@ -1,10 +1,10 @@
import { WiDaySunny, WiNightClear, WiDayCloudy, WiNightCloudy, WiCloud, WiCloudy, WiDayShowers, WiNightShowers, WiRain, WiThunderstorm, WiSnow, WiFog } from 'weather-icons-react';
-export default function WeatherIcon(props) {
+export default function WeatherIcon({ name }) {
let icon;
- // props.name is the openweathermap icon name, see https://openweathermap.org/weather-conditions
- switch (props.name) {
+ // name is the openweathermap icon name, see https://openweathermap.org/weather-conditions
+ switch (name) {
case '01d': icon =
; break;
case '01n': icon =
; break;
case '02d': icon =
; break;
diff --git a/src/components/widgets/weather/WindDirectionIcon.jsx b/src/components/widgets/weather/WindDirectionIcon.jsx
index 05052f4a..426d2673 100644
--- a/src/components/widgets/weather/WindDirectionIcon.jsx
+++ b/src/components/widgets/weather/WindDirectionIcon.jsx
@@ -1,9 +1,8 @@
import { WiDirectionDownLeft, WiDirectionDownRight, WiDirectionDown, WiDirectionLeft, WiDirectionRight, WiDirectionUpLeft, WiDirectionUpRight, WiDirectionUp } from 'weather-icons-react';
-export default function WindDirectionIcon(props) {
+// degrees is imported because of a potential bug, idk what causes it but now it is fixed
+export default function WindDirectionIcon({ degrees }) {
let icon;
- // fix potential bug, idk what causes it but now it is fixed
- let degrees = props.degrees;
// convert the number openweathermap gives us to closest direction or something
const directions = ['North', 'North-West', 'West', 'South-West', 'South', 'South-East', 'East', 'North-East'];
diff --git a/src/modules/helpers/background/hexToRgb.js b/src/modules/helpers/background/hexToRgb.js
index 6b49f1e6..587b4313 100644
--- a/src/modules/helpers/background/hexToRgb.js
+++ b/src/modules/helpers/background/hexToRgb.js
@@ -2,7 +2,6 @@ import rgbToHsv from './rgbToHsv';
import setRgba from './setRgba';
const hexRegexp = /(^#{0,1}[0-9A-F]{6}$)|(^#{0,1}[0-9A-F]{3}$)|(^#{0,1}[0-9A-F]{8}$)/i;
-
const regexp = /([0-9A-F])([0-9A-F])([0-9A-F])/i;
export default function hexToRgb(value) {