From bfff1f14b9e4013dc045967ac293eea1210c7820 Mon Sep 17 00:00:00 2001 From: Sped32DJ Date: Sat, 20 Jan 2024 22:00:55 -0800 Subject: [PATCH] idk, something changed --- src/WeatherCard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/WeatherCard.js b/src/WeatherCard.js index 62e450a..af28f7e 100644 --- a/src/WeatherCard.js +++ b/src/WeatherCard.js @@ -6,6 +6,8 @@ const WeatherCard = ({ weatherData }) => { if (!weatherData || !weatherData.current_condition || weatherData.current_condition.length === 0) { return null; // Return null or some loading indicator if weatherData is not available yet } + const nearestArea = weatherData.nearest_area[0]; + const cityName = nearestArea.areaName[0].value; const currentCondition = weatherData.current_condition[0]; // const getCity = nearestArea.areaName[0].value; @@ -45,7 +47,7 @@ const WeatherCard = ({ weatherData }) => { return (
-

Weather Information

+

Weather Information for {cityName}

Temperature: {temperature}°F

Wind Speed: {windSpeed} mph

Precipitation: {precipitation} MM