Refactor weather
This commit is contained in:
@@ -15,25 +15,29 @@ export function Weather() {
|
||||
return (
|
||||
<div class={style.Weather}>
|
||||
<Show when={weather()} fallback="Loading">
|
||||
<div class={`${style.WeatherLine} ${style.Delimiter}`}>
|
||||
<i class={`wi wi-owm-${weather()?.id} ${style.WeatherIcon}`}></i>
|
||||
<div class={style.FeelsLike}>
|
||||
<span>{weather()?.feels_like}°</span>
|
||||
<span>{weather()?.main}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class={style.WeatherLine}>
|
||||
<HiSolidArrowDown color="lightcoral" />
|
||||
{weather()?.temp_min}° <HiSolidArrowUp color="lightgreen" /> {weather()?.temp_max}
|
||||
°
|
||||
<WiHumidity />
|
||||
{weather()?.humidity}%<br />
|
||||
</div>
|
||||
<div class={style.WeatherLine}></div>
|
||||
<div class={style.WeatherLine}>
|
||||
<WiSunrise /> {sunrise()}
|
||||
<WiSunset /> {sunset()}
|
||||
</div>
|
||||
{(weather) => (
|
||||
<>
|
||||
<div class={`${style.WeatherLine} ${style.Delimiter}`}>
|
||||
<i class={`wi wi-owm-${weather().id} ${style.WeatherIcon}`}></i>
|
||||
<div class={style.FeelsLike}>
|
||||
<span>{weather().feels_like}°</span>
|
||||
<span>{weather().main}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class={style.WeatherLine}>
|
||||
<HiSolidArrowDown color="lightcoral" />
|
||||
{weather().temp_min}° <HiSolidArrowUp color="lightgreen" /> {weather().temp_max}
|
||||
°
|
||||
<WiHumidity />
|
||||
{weather().humidity}%<br />
|
||||
</div>
|
||||
<div class={style.WeatherLine}></div>
|
||||
<div class={style.WeatherLine}>
|
||||
<WiSunrise /> {sunrise()}
|
||||
<WiSunset /> {sunset()}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</Show>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user