diff --git a/src/components/WeatherModal/ExtendedForecastDetails.tsx b/src/components/WeatherModal/ExtendedForecastDetails.tsx index af1f5b9..b4e609b 100644 --- a/src/components/WeatherModal/ExtendedForecastDetails.tsx +++ b/src/components/WeatherModal/ExtendedForecastDetails.tsx @@ -1,11 +1,18 @@ -import { Box, Card, Group, Stack, Text } from '@mantine/core'; +import { ActionIcon, Box, Card, Group, Stack, Text } from '@mantine/core'; import { FaArrowDown, FaArrowUp, FaLocationArrow, FaSun, FaWind } from 'react-icons/fa'; +import { FaX } from 'react-icons/fa6'; import { WiRain, WiSunrise, WiSunset } from 'react-icons/wi'; import { WeatherCodes } from 'types'; import WeatherFeaturePill from './WeatherFeaturePill'; import WeatherIcon from './WeatherIcon'; -export default function ExtendedForecastDetails({ selectedDay }: { selectedDay: any }) { +export default function ExtendedForecastDetails({ + selectedDay, + setSelectedDay, +}: { + selectedDay: any; + setSelectedDay: (day: any) => void; +}) { return ( { e.stopPropagation(); @@ -22,17 +30,32 @@ export default function ExtendedForecastDetails({ selectedDay }: { selectedDay: shadow='xl' p={0} > + { + setSelectedDay(undefined); + }} + > + + - + {selectedDay.time.toLocaleDateString('en-US', { weekday: 'long' })} - {selectedDay.time.toLocaleDateString()} + + {selectedDay.time.toLocaleDateString()} + diff --git a/src/components/WeatherModal/WeatherGraphs.tsx b/src/components/WeatherModal/WeatherGraphs.tsx index 215ba1c..dba8ea4 100644 --- a/src/components/WeatherModal/WeatherGraphs.tsx +++ b/src/components/WeatherModal/WeatherGraphs.tsx @@ -29,7 +29,7 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined } return { dewpoint: hourly.dew_point_2m?.[index].toFixed(0), isDaytime: hourly.is_day?.[index], - name: hourly.time[index], + name: hourly.time[index].toLocaleString('en-us'), startTime: hourly.time[index], endTime: hourly.time[index + 1], probabilityOfPrecipitation: hourly.precipitation_probability?.[index], @@ -39,7 +39,6 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined } }; }) .filter((hour: any) => hour.startTime > now && hour.startTime < later); - return ( setTimeFrame(value)} @@ -78,10 +77,7 @@ export default function WeatherGraphs({ hourly }: { hourly: Hourly | undefined } type='category' stroke={'var(--mantine-color-primary-0)'} dataKey={(data) => { - return new Date(data.startTime).toLocaleTimeString('en-US', { - hour: 'numeric', - minute: 'numeric', - }); + return new Date(data.startTime).toLocaleString('en-US'); }} /> { - return new Date(data.startTime).toLocaleTimeString('en-US', { - hour: 'numeric', - minute: 'numeric', - }); + return new Date(data.startTime).toLocaleTimeString('en-US'); }} /> diff --git a/src/components/WeatherModal/WeatherModal.tsx b/src/components/WeatherModal/WeatherModal.tsx index d745220..d63ab50 100644 --- a/src/components/WeatherModal/WeatherModal.tsx +++ b/src/components/WeatherModal/WeatherModal.tsx @@ -72,7 +72,10 @@ export function WeatherModal({ }} > - + )}