fix: firefox changelog date, cleanup background a bit

This commit is contained in:
David Ralph
2021-07-19 10:20:00 +01:00
parent c9f2af6b96
commit d7be6e351d
4 changed files with 8 additions and 10 deletions

View File

@@ -25,7 +25,7 @@ export default class Changelog extends React.PureComponent {
return;
}
let date = new Date(data.date);
let date = new Date(data.date.split(' ')[0]);
date = date.toLocaleDateString(window.languagecode.replace('_', '-'), {
year: 'numeric',
month: 'long',

View File

@@ -99,7 +99,6 @@ export default class Background extends React.PureComponent {
backgroundImage.classList.remove('backgroundPreload');
backgroundImage.classList.add('fade-in');
// this doesn't make it fetch again which is nice
backgroundImage.style.background = `url(${url})`;
// remove the preloader element we created earlier
preloader.remove();
@@ -149,7 +148,6 @@ export default class Background extends React.PureComponent {
let requestURL, data;
switch (backgroundAPI) {
case 'unsplash':
//requestURL = `${window.constants.UNSPLASH_URL}/getImage?category=${apiCategory}`;
requestURL = `${window.constants.UNSPLASH_URL}/images/random?quality=${apiQuality}`;
break;
case 'pexels':
@@ -169,8 +167,7 @@ export default class Background extends React.PureComponent {
}
let credit = data.photographer;
let photoURL = '';
let photographerURL = '';
let photoURL, photographerURL;
if (backgroundAPI === 'unsplash') {
credit = data.photographer + ` ${this.language.unsplash}`;
@@ -308,7 +305,6 @@ export default class Background extends React.PureComponent {
document.getElementById('backgroundVideo').style.display = 'block';
} else {
if (this.state.photoInfo.hidden === false) {
// fix bug
try {
document.querySelector('.photoInformation').style.display = 'block';
} catch (e) {

View File

@@ -61,7 +61,9 @@ export default function PhotoInformation(props) {
return (
<div className='photoInformation'>
<h1>{photo} <span id='credit'>{credit}</span></h1>
{localStorage.getItem('photoInformation') !== 'false' ? <><Info className='photoInformationHover'/>
{localStorage.getItem('photoInformation') !== 'false' ?
<>
<Info className='photoInformationHover'/>
<div className={props.className || 'infoCard'}>
<Info className='infoIcon'/>
<h1>{language.information}</h1>
@@ -80,7 +82,7 @@ export default function PhotoInformation(props) {
<span className='download' onClick={() => downloadImage(props.info)}>{language.download}</span>
</> : null}
</div>
</>: null}
</> : null}
</div>
);
}