feat: widget zoom for weather and fixes

This commit is contained in:
David Ralph
2021-05-07 13:27:28 +01:00
parent cb129238cb
commit 7327382497
6 changed files with 16 additions and 7 deletions

View File

@@ -59,7 +59,7 @@ export default class Quote extends React.PureComponent {
return this.setState({
quote: favouriteQuote.split(' - ')[0],
author: favouriteQuote.split(' - ')[1],
authorlink: this.getAuthorLink(data.author)
authorlink: this.getAuthorLink(favouriteQuote.split(' - ')[1])
});
}
@@ -132,8 +132,6 @@ export default class Quote extends React.PureComponent {
return this.doOffline();
}
console.log(this.getAuthorLink(data.author))
this.setState({
quote: '"' + data.quote + '"',
author: data.author,

View File

@@ -110,15 +110,20 @@ export default class Weather extends React.PureComponent {
original_temp_max: data.main.temp_max
}
});
document.querySelector('.weather svg').style.fontSize = `${0.95 * Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
}
componentDidMount() {
EventBus.on('refresh', (data) => {
if (data === 'weather') {
this.getWeather();
document.querySelector('.weather').style.fontSize = `${Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
document.querySelector('.weather svg').style.fontSize = `${0.95 * Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
}
});
document.querySelector('.weather').style.fontSize = `${Number((localStorage.getItem('zoomWeather') || 100) / 100)}em`;
this.getWeather();
}