mirror of
https://github.com/mue/mue.git
synced 2026-07-17 05:54:14 +02:00
chore(fix): deprecate pexels, explanation to come
This commit is contained in:
@@ -180,11 +180,7 @@ export default class BackgroundSettings extends PureComponent {
|
||||
{
|
||||
name: 'Unsplash',
|
||||
value: 'unsplash',
|
||||
},
|
||||
{
|
||||
name: 'Pexels',
|
||||
value: 'pexels',
|
||||
},
|
||||
}
|
||||
]}
|
||||
name="backgroundAPI"
|
||||
category="background"
|
||||
|
||||
@@ -107,10 +107,8 @@ export default class Background extends PureComponent {
|
||||
let requestURL, data;
|
||||
switch (backgroundAPI) {
|
||||
case 'unsplash':
|
||||
requestURL = `${variables.constants.API_URL}/images/unsplash?categories=${apiCategories}&quality=${apiQuality}`;
|
||||
break;
|
||||
case 'pexels':
|
||||
requestURL = `${variables.constants.API_URL}/images/pexels?quality=${apiQuality}`;
|
||||
requestURL = `${variables.constants.API_URL}/images/unsplash?categories=${apiCategories}&quality=${apiQuality}`;
|
||||
break;
|
||||
// Defaults to Mue
|
||||
default:
|
||||
@@ -129,7 +127,7 @@ export default class Background extends PureComponent {
|
||||
|
||||
let photoURL, photographerURL;
|
||||
|
||||
if (backgroundAPI === 'unsplash' || backgroundAPI === 'pexels') {
|
||||
if (backgroundAPI === 'unsplash') {
|
||||
photoURL = data.photo_page;
|
||||
photographerURL = data.photographer_page;
|
||||
}
|
||||
|
||||
@@ -68,48 +68,29 @@ function PhotoInformation({ info, url, api }) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// remove unsplash and pexels text
|
||||
// remove unsplash text
|
||||
const unsplash = variables.getMessage('widgets.background.unsplash');
|
||||
const pexels = variables.getMessage('widgets.background.pexels');
|
||||
|
||||
let credit = info.credit;
|
||||
let photo = variables.getMessage('widgets.background.credit');
|
||||
|
||||
// unsplash and pexels credit
|
||||
// unsplash credit
|
||||
if (info.photographerURL && info.photographerURL !== '' && !info.offline && api) {
|
||||
if (api === 'unsplash') {
|
||||
photo = (
|
||||
<a href={info.photoURL + '?utm_source=mue'} target="_blank" rel="noopener noreferrer">
|
||||
{photo}
|
||||
photo = (
|
||||
<a href={info.photoURL + '?utm_source=mue'} target="_blank" rel="noopener noreferrer">
|
||||
{photo}
|
||||
</a>
|
||||
);
|
||||
credit = (
|
||||
<>
|
||||
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
|
||||
{info.credit}
|
||||
</a>{' '}
|
||||
<a href="https://unsplash.com?utm_source=mue" target="_blank" rel="noopener noreferrer">
|
||||
{unsplash}
|
||||
</a>
|
||||
);
|
||||
credit = (
|
||||
<>
|
||||
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
|
||||
{info.credit}
|
||||
</a>{' '}
|
||||
<a href="https://unsplash.com?utm_source=mue" target="_blank" rel="noopener noreferrer">
|
||||
{unsplash}
|
||||
</a>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
photo = (
|
||||
<a href={info.photoURL} target="_blank" rel="noopener noreferrer">
|
||||
{photo}
|
||||
</a>
|
||||
);
|
||||
credit = (
|
||||
<>
|
||||
<a href={info.photographerURL} target="_blank" rel="noopener noreferrer">
|
||||
{info.credit}
|
||||
</a>{' '}
|
||||
<a href="https://pexels.com" target="_blank" rel="noopener noreferrer">
|
||||
{pexels}
|
||||
</a>
|
||||
</>
|
||||
);
|
||||
}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const ddgProxy = localStorage.getItem('ddgProxy') === 'true';
|
||||
|
||||
Reference in New Issue
Block a user