mirror of
https://github.com/mue/mue.git
synced 2026-06-12 03:28:46 +02:00
feat: favourite background now shows all photo info
This commit is contained in:
@@ -130,7 +130,10 @@ export default class Background extends React.PureComponent {
|
||||
return this.setState({
|
||||
url: favourited.url,
|
||||
photoInfo: {
|
||||
credit: favourited.credit
|
||||
credit: favourited.credit,
|
||||
location: favourited.location,
|
||||
camera: favourited.camera,
|
||||
resolution: favourited.resolution
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -21,9 +21,18 @@ export default class Favourite extends React.PureComponent {
|
||||
});
|
||||
} else {
|
||||
const url = document.getElementById('backgroundImage').style.backgroundImage.replace('url("', '').replace('")', '');
|
||||
const credit = document.getElementById('credit').textContent;
|
||||
|
||||
localStorage.setItem('favourite', JSON.stringify({ url: url, credit: credit }));
|
||||
if (!url) {
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem('favourite', JSON.stringify({
|
||||
url: url,
|
||||
credit: document.getElementById('credit').textContent,
|
||||
location: document.getElementById('infoLocation').textContent,
|
||||
camera: document.getElementById('infoCamera').textContent,
|
||||
resolution: document.getElementById('infoResolution').textContent
|
||||
}));
|
||||
|
||||
this.setState({
|
||||
favourited: <StarIcon onClick={this.favourite} className='topicons' />
|
||||
|
||||
@@ -55,11 +55,11 @@ export default function PhotoInformation(props) {
|
||||
<h1>{language.information}</h1>
|
||||
<hr/>
|
||||
<Location/>
|
||||
<span>{props.info.location || 'N/A'}</span>
|
||||
<span id='infoLocation'>{props.info.location || 'N/A'}</span>
|
||||
<Camera/>
|
||||
<span>{props.info.camera || 'N/A'}</span>
|
||||
<span id='infoCamera'>{props.info.camera || 'N/A'}</span>
|
||||
<Resolution/>
|
||||
<span>{props.info.resolution || 'N/A'}</span>
|
||||
<span id='infoResolution'>{props.info.resolution || 'N/A'}</span>
|
||||
<Photographer/>
|
||||
<span>{photographer}</span>
|
||||
{(localStorage.getItem('downloadbtn') === 'true') && !props.info.offline && !props.info.photographerURL ?
|
||||
|
||||
Reference in New Issue
Block a user