Minor fixes & linted

This commit is contained in:
Sean Edmunds
2024-12-05 16:15:07 -06:00
parent 7f219618a3
commit 62b2f4c661
3 changed files with 15 additions and 12 deletions

View File

@@ -104,9 +104,10 @@ export default function Homepage({ theme }: any) {
precipitation: precipitation:
weather.features[0].properties.precipitationLastHour.value || 'N/A', weather.features[0].properties.precipitationLastHour.value || 'N/A',
humidity: Math.round(weather.features[0].properties.relativeHumidity.value), humidity: Math.round(weather.features[0].properties.relativeHumidity.value),
heatIndex: Math.round(weather.features[0].properties.heatIndex.value !== null ? heatIndex: Math.round(
(weather.features[0].properties.heatIndex.value * 9) / 5 + 32 weather.features[0].properties.heatIndex.value !== null
: (weather.features[0].properties.temperature.value * 9) / 5 + 32, ? (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), windSpeed: Math.round(weather.features[0].properties.windSpeed.value / 1.60934),
windDirection: weather.features[0].properties.windDirection.value, windDirection: weather.features[0].properties.windDirection.value,

View File

@@ -12,7 +12,7 @@ export enum WindDirection {
NW = 315, NW = 315,
} }
export default function HourlyCard({ weather }: any) {; export default function HourlyCard({ weather }: any) {
return ( return (
<Stack gap={0} align='center'> <Stack gap={0} align='center'>
<Card <Card
@@ -105,13 +105,15 @@ export default function HourlyCard({ weather }: any) {;
background: 'rgba(0, 0, 0, 0.6)', background: 'rgba(0, 0, 0, 0.6)',
}} }}
> >
<Group gap={0} justify='center'><Icon <Group gap={0} justify='center'>
icon={'mdi:drop'} <Icon
style={{ icon={'mdi:drop'}
transform: `rotate(${WindDirection[weather.windDirection]}deg)`, style={{
}} transform: `rotate(${WindDirection[weather.windDirection]}deg)`,
/> }}
{`${weather.probabilityOfPrecipitation.value*10}`}%</Group> />
{`${weather.probabilityOfPrecipitation.value * 10}`}%
</Group>
</Text> </Text>
</Stack> </Stack>
); );

View File

@@ -46,7 +46,7 @@ export default function SmallWeatherCard({ weather }: any) {
{weather.temperature}°F {weather.temperature}°F
</Text> </Text>
<Text mt={-8} fz={12}> <Text mt={-8} fz={12}>
Feels like: {weather.heatIndex} °F Feels like: {weather.heatIndex}°F
</Text> </Text>
<Text mt={-6} fz={12}> <Text mt={-6} fz={12}>
Humidity: {weather.humidity}% Humidity: {weather.humidity}%