Fixing missing styling variables

This commit is contained in:
Jas Singh
2024-07-24 19:04:22 -07:00
parent 21393c122a
commit 7a5093a111
7 changed files with 590 additions and 540 deletions

View File

@@ -1,28 +1,28 @@
import icons from "../../../../../icons/index.js";
export const HourlyIcon = (theWeather, getNextEpoch) => {
return Widget.Icon({
class_name: "hourly-weather-icon",
icon: theWeather.bind("value").as((w) => {
if (!Object.keys(w).length) {
return "-";
}
return Widget.Icon({
class_name: "hourly-weather-icon",
icon: theWeather.bind("value").as((w) => {
if (!Object.keys(w).length) {
return "-";
}
const nextEpoch = getNextEpoch(w);
const weatherAtEpoch = w.forecast.forecastday[0].hour.find(
(h) => h.time_epoch === nextEpoch,
);
const nextEpoch = getNextEpoch(w);
const weatherAtEpoch = w.forecast.forecastday[0].hour.find(
(h) => h.time_epoch === nextEpoch,
);
let iconQuery = weatherAtEpoch?.condition.text
.trim()
.toLowerCase()
.replaceAll(" ", "_");
let iconQuery = weatherAtEpoch?.condition.text
.trim()
.toLowerCase()
.replaceAll(" ", "_");
if (!weatherAtEpoch?.isDay && iconQuery === "partly_cloudy") {
iconQuery = "partly_cloudy_night";
}
if (!weatherAtEpoch?.isDay && iconQuery === "partly_cloudy") {
iconQuery = "partly_cloudy_night";
}
return icons.weather[iconQuery];
}),
});
return icons.weather[iconQuery];
}),
});
};