diff --git a/README.md b/README.md index 90cb2a7..cf1ca74 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,5 @@ sudo pm2 start server.cjs - Image uploads for backgrounds - Improve mobile + +- Update weather modal with design from https://github.com/esnz/react-weather-app?tab=readme-ov-file \ No newline at end of file diff --git a/src/components/WeatherModal/HourlyCard.tsx b/src/components/WeatherModal/HourlyCard.tsx index b7cb916..4338c9b 100644 --- a/src/components/WeatherModal/HourlyCard.tsx +++ b/src/components/WeatherModal/HourlyCard.tsx @@ -29,13 +29,6 @@ export default function HourlyCard({ weather }: any) { > - - {new Date(weather.startTime).toLocaleString('en-US', { - weekday: 'short', - month: 'numeric', - day: 'numeric', - })} - {new Date(weather.startTime).toLocaleTimeString('en-US', { hour: 'numeric', diff --git a/src/components/WeatherModal/WeatherModal.tsx b/src/components/WeatherModal/WeatherModal.tsx index c773d04..3d6bf23 100644 --- a/src/components/WeatherModal/WeatherModal.tsx +++ b/src/components/WeatherModal/WeatherModal.tsx @@ -1,4 +1,4 @@ -import { Box, Center, Divider, Group, Modal, Stack } from '@mantine/core'; +import { Box, Center, Divider, Group, Modal, Stack, Text } from '@mantine/core'; import { modalClasses } from 'styles'; import SmallOutlookCard from './SmallOutlookCard'; import SmallWeatherCard from './SmallWeatherCard'; @@ -15,8 +15,15 @@ export function WeatherModal({ }: any) { const [hourlyForecast, setHourlyForecast] = useState([]); const [sunset, setSunset] = useState(100); - const { theme, isMobile, hourly, setProviderLabel, setSearchValue, setProviderURL } = - useCommonHooks(); + const { + theme, + isMobile, + hourly, + setProviderLabel, + setSearchValue, + setProviderURL, + personal, + } = useCommonHooks(); useEffect(() => { if (hourly) { setHourlyForecast(hourly.properties.periods.slice(1, 13)); @@ -62,7 +69,16 @@ export function WeatherModal({ - Weather Forecast + + + + Weather Forecast for{' '} + + + {personal?.[0].physicalAddress} + + + diff --git a/src/hooks/useCommonHooks.ts b/src/hooks/useCommonHooks.ts index c67ea45..4e019dc 100644 --- a/src/hooks/useCommonHooks.ts +++ b/src/hooks/useCommonHooks.ts @@ -158,8 +158,8 @@ export function useCommonHooks() { const { data: weatherMetadata } = useOSMAPI({ address: personal?.[0].physicalAddress }); const { data: points } = useWeatherAPI({ endpoint: 'points', - lat: weatherMetadata?.[0].lat, - lon: weatherMetadata?.[0].lon, + lat: weatherMetadata?.[0].lat || 0, + lon: weatherMetadata?.[0].lon || 0, }); const { data: basicWeather } = useWeatherAPI({ endpoint: 'baseline', diff --git a/src/pages/homepage/Homepage.tsx b/src/pages/homepage/Homepage.tsx index 60c5a95..c0eddbb 100644 --- a/src/pages/homepage/Homepage.tsx +++ b/src/pages/homepage/Homepage.tsx @@ -23,6 +23,7 @@ export function Homepage() { forecast, personal, } = useCommonHooks(); + const [current, setCurrent] = useState({ icon: '', temperature: 0, diff --git a/src/styles/ActionIcon.module.css b/src/styles/ActionIcon.module.css index ed4177d..11cf877 100644 --- a/src/styles/ActionIcon.module.css +++ b/src/styles/ActionIcon.module.css @@ -5,6 +5,7 @@ width: 2rem; height: 2rem; margin-right: 1rem; + margin-top: 1.5rem; .icon { font-size: 24px; } diff --git a/src/styles/Modal.module.css b/src/styles/Modal.module.css index d262506..d1f501f 100644 --- a/src/styles/Modal.module.css +++ b/src/styles/Modal.module.css @@ -1,9 +1,14 @@ .helpModal { &.root { .content { + border-radius: 15px; color: var(--color-text-pri); background-color: var(--color-background); .header { + color: var(--color-text-pri); + .title { + font-size: 22px; + } .close { color: white; background-color: var(--mantine-color-red-6); @@ -15,6 +20,9 @@ } } } + .body { + margin-top: 1rem; + } } }