chore: run prettier

Co-authored-by: Isaac <contact@eartharoid.me>
This commit is contained in:
alexsparkes
2024-05-21 20:51:33 +01:00
parent bf78a8a9f5
commit 003bf2400a
32 changed files with 229 additions and 184 deletions

View File

@@ -5,7 +5,6 @@ import WeatherIcon from './components/WeatherIcon';
import Expanded from './components/Expanded';
import WeatherSkeleton from './components/WeatherSkeleton';
import EventBus from 'utils/eventbus';
import { getWeather } from './api/getWeather.js';
@@ -44,7 +43,6 @@ class WeatherWidget extends PureComponent {
}
render() {
const weatherType = localStorage.getItem('weatherType') || 1;
if (this.state.done === false) {

View File

@@ -68,8 +68,11 @@ export const getWeather = async (location, done) => {
},
done: true,
};
localStorage.setItem('currentWeather', JSON.stringify({ data: cacheable, cachedAt: Date.now() }));
return cacheable
localStorage.setItem(
'currentWeather',
JSON.stringify({ data: cacheable, cachedAt: Date.now() }),
);
return cacheable;
} catch (error) {
console.error('Fetch Error: ', error);
}

View File

@@ -10,40 +10,40 @@ function WeatherSkeleton({ weatherType }) {
<span className="pulse">20C</span>
</div>
{weatherType >= 2 && (
<span className="minmax">
<span className="subtitle pulse">min</span>
<span className="subtitle pulse">max</span>
</span>
<span className="minmax">
<span className="subtitle pulse">min</span>
<span className="subtitle pulse">max</span>
</span>
)}
</div>
{weatherType >= 2 && (
<div className="extra-info">
<span className="pulse">feels like x</span>
<span className="loc pulse">location</span>
</div>
<div className="extra-info">
<span className="pulse">feels like x</span>
<span className="loc pulse">location</span>
</div>
)}
</div>
{weatherType >= 3 && (
<div className="weatherExpandedInfo">
<span className="subtitle pulse">extra information</span>
<div className="weatherExpandedInfoItems">
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
</div>
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
</div>
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
<div className="weatherExpandedInfo">
<span className="subtitle pulse">extra information</span>
<div className="weatherExpandedInfoItems">
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
</div>
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
</div>
<div className="infoItemSkeleton">
<div className="smallSkeletonIcon pulse"></div>
<span className="loc pulse">location</span>
</div>
</div>
</div>
</div>
)}
</div>
);
}
export default memo(WeatherSkeleton);
export default memo(WeatherSkeleton);