Address updates

This commit is contained in:
Sean Edmunds
2025-01-29 14:36:31 -06:00
parent f9cc1ab63a
commit e87f4abec9
7 changed files with 118 additions and 65 deletions

View File

@@ -79,11 +79,11 @@ export function Homepage() {
}, [messages, isMessagesFetching]);
useEffect(() => {
if (weather && basicWeather) {
if (weather !== undefined && basicWeather !== undefined) {
setCurrent({
icon: weather.features[0].properties.icon?.replace('medium', 'large') || '',
icon: weather.features[0]?.properties.icon?.replace('medium', 'large') || '',
temperature: Math.round(
(weather.features[0].properties.temperature.value * 9) / 5 + 32,
(weather.features[0]?.properties.temperature.value * 9) / 5 + 32,
),
highTemp: Math.round(
(basicWeather.properties.maxTemperature.values[0].value * 9) / 5 + 32,
@@ -92,15 +92,15 @@ export function Homepage() {
(basicWeather.properties.minTemperature.values[0].value * 9) / 5 + 32,
),
precipitation:
weather.features[0].properties.precipitationLastHour.value || 'N/A',
humidity: Math.round(weather.features[0].properties.relativeHumidity.value),
weather.features[0]?.properties.precipitationLastHour.value || 'N/A',
humidity: Math.round(weather.features[0]?.properties.relativeHumidity.value),
heatIndex: Math.round(
weather.features[0].properties.heatIndex.value !== null
? (weather.features[0].properties.heatIndex.value * 9) / 5 + 32
: (weather.features[0].properties.temperature.value * 9) / 5 + 32,
weather.features[0]?.properties.heatIndex.value !== null
? (weather.features[0]?.properties.heatIndex.value * 9) / 5 + 32
: (weather.features[0]?.properties.temperature.value * 9) / 5 + 32,
),
windSpeed: Math.round(weather.features[0].properties.windSpeed.value / 1.60934),
windDirection: weather.features[0].properties.windDirection.value,
windSpeed: Math.round(weather.features[0]?.properties.windSpeed.value / 1.60934),
windDirection: weather.features[0]?.properties.windDirection.value,
});
}
}, [weather, basicWeather]);

View File

@@ -31,11 +31,11 @@ function Header({
}, []);
useEffect(() => {
if (weather && basicWeather) {
if (weather !== undefined && basicWeather !== undefined) {
setCurrent({
icon: weather.features[0].properties.icon?.replace('medium', 'large') || '',
icon: weather.features[0]?.properties.icon?.replace('medium', 'large') || '',
temperature: Math.round(
(weather.features[0].properties.temperature.value * 9) / 5 + 32,
(weather.features[0]?.properties.temperature.value * 9) / 5 + 32,
),
highTemp: Math.round(
(basicWeather.properties.maxTemperature.values[0].value * 9) / 5 + 32,
@@ -44,13 +44,13 @@ function Header({
(basicWeather.properties.minTemperature.values[0].value * 9) / 5 + 32,
),
precipitation:
weather.features[0].properties.precipitationLastHour.value || 'N/A',
humidity: Math.round(weather.features[0].properties.relativeHumidity.value),
weather.features[0]?.properties.precipitationLastHour.value || 'N/A',
humidity: Math.round(weather.features[0]?.properties.relativeHumidity.value),
heatIndex: Math.round(
(weather.features[0].properties.heatIndex.value * 9) / 5 + 32,
(weather.features[0]?.properties.heatIndex.value * 9) / 5 + 32,
),
windSpeed: Math.round(weather.features[0].properties.windSpeed.value / 1.60934),
windDirection: weather.features[0].properties.windDirection.value,
windSpeed: Math.round(weather.features[0]?.properties.windSpeed.value / 1.60934),
windDirection: weather.features[0]?.properties.windDirection.value,
});
}
}, [weather, basicWeather]);

View File

@@ -13,8 +13,9 @@ import {
import { useCommonHooks, useMutationAPI, useQueryAPI } from 'hooks';
import { useEffect, useState } from 'react';
import { FaDice } from 'react-icons/fa';
import { FiMenu, FiMonitor, FiSettings, FiShuffle } from 'react-icons/fi';
import { FiMenu, FiPower, FiSettings, FiShuffle } from 'react-icons/fi';
import { useNavigate } from 'react-router-dom';
import { toast } from 'react-toastify';
import {
actionIconClasses,
buttonClasses,
@@ -40,9 +41,10 @@ function SettingsButton() {
setBookmarkFilter,
isMobile,
wolClients,
notify,
} = useCommonHooks();
const notify = (notification: any) => toast(notification, { position: 'bottom-right' });
const [selectedClient, setSelectedClient] = useState<any>(wolClients?.[0]);
const [overlayOpened, setOverlayOpened] = useState(false);
const handleWakeRequest = () => {
@@ -113,7 +115,7 @@ function SettingsButton() {
}}
>
<Stack gap={0} align='center'>
<FiMonitor size={40} />
<FiPower size={32} />
</Stack>
</Button>
<Select