fix: unsplash links etc

This commit is contained in:
David Ralph
2021-04-27 14:52:04 +01:00
parent 8f017cda32
commit 133db009aa
6 changed files with 35 additions and 8 deletions

View File

@@ -15,7 +15,10 @@ export default class Background extends React.PureComponent {
url: '',
currentAPI: '',
photoInfo: {
hidden: false
hidden: false,
offline: false,
photographerURL: '',
photoURL: ''
}
};
this.language = window.language.widgets.background;
@@ -55,6 +58,7 @@ export default class Background extends React.PureComponent {
this.setState({
url: `./offline-images/${randomImage}.webp`,
photoInfo: {
offline: true,
credit: photographer
}
});
@@ -158,7 +162,9 @@ export default class Background extends React.PureComponent {
location: (data.location.replace(/[null]+/g, '') !== ' ') ? data.location : 'N/A',
camera: data.camera,
resolution: data.resolution,
url: data.file
url: data.file,
photographerURL: (backgroundAPI === 'unsplash') ? data.photographer_page : '',
photoURL: (backgroundAPI === 'unsplash') ? data.photo_page : ''
}
});
break;