diff --git a/components/Temperature.tsx b/components/Temperature.tsx
index 56df4c4..bdc01ef 100644
--- a/components/Temperature.tsx
+++ b/components/Temperature.tsx
@@ -1,4 +1,3 @@
-import { TempInfo } from "@/types/types";
import { useContext } from "react";
import { WeatherContext } from "./WeatherNow";
diff --git a/components/WeatherIcon.tsx b/components/WeatherIcon.tsx
index 37e8fa8..ae32b51 100644
--- a/components/WeatherIcon.tsx
+++ b/components/WeatherIcon.tsx
@@ -1,9 +1,93 @@
import Image from "next/image";
-import sunnyColor from '../public/sunny.svg'
+import cloudAndLightening from '../public/cloud-and-lightening.svg'
+import cloudAndMoon from '../public/cloud-and-moon.svg'
+import cloudAndRain from '../public/cloud-and-rain.svg'
+import cloudAndSnow from '../public/cloud-and-snow.svg'
+import cloudAndWind from '../public/cloud-and-wind.svg'
+import cloudSnowRain from '../public/cloud-snow-rain.svg'
+import cloudAndSun from '../public/cloud-and-sun.svg'
+import cloudWindRain from '../public/cloud-wind-rain.svg'
+import cloud from '../public/cloud.svg'
+import moon from '../public/moon.svg'
+import sun from '../public/sun.svg'
+
import { useContext } from "react";
+import { WeatherContext } from "./WeatherNow";
+import { HourlyForecast } from "@/types/types";
+
+
+
+function getCurrentWeatherIcon(weather: HourlyForecast) {
+ const weatherCode = weather.current.weather_code;
+ switch (weatherCode) {
+ default:
+ return sun;
+ case 0: // clear sky
+ return sun;
+ case 1: // clear mainly
+ return cloudAndSun;
+ case 2: // partly cloudy
+ return cloud;
+ case 3: // overcast
+ return cloud;
+ case 45: // fog
+ return cloud;
+ case 48: // fog rime
+ return cloud;
+ case 51: // drizzle light
+ return cloudAndRain;
+ case 53: // drizzle moderate
+ return cloudAndRain;
+ case 55: // drizzle dense
+ return cloudAndRain;
+ case 56: // drizzle light freezing
+ return cloudSnowRain;
+ case 57: // drizzle dense freezing
+ return cloudSnowRain;
+ case 61: // rain slight
+ return cloudAndRain;
+ case 63: // rain moderate
+ return cloudAndRain;
+ case 65: // rain heavy
+ return cloudAndRain;
+ case 66: // rain light freezing
+ return cloudWindRain;
+ case 67: // rain dense freezing
+ return cloudWindRain;
+ case 71: // snow slight
+ return cloudAndSnow;
+ case 73: // snow moderate
+ return cloudAndSnow;
+ case 75: // snow heavy
+ return cloudAndSnow;
+ case 77: // snow grains
+ return cloudAndSnow;
+ case 80: // rain showers slight
+ return cloudAndRain;
+ case 81: // rain showers moderate
+ return cloudAndRain;
+ case 82: // rain showers violent
+ return cloudAndRain;
+ case 85: // snow showers slight
+ return cloudAndSnow;
+ case 86: // snow showers heavy
+ return cloudAndSnow;
+ case 95: // thunderstorm
+ return cloudAndLightening;
+ case 96: //thunderstorm hail slight
+ return cloudAndLightening;
+ case 99: //thunderstorm hail heavy
+ return cloudAndLightening;
+ }
+};
+
export default function WeatherIcon() {
+ const { weather } = useContext(WeatherContext)
return(
-
{weather.current.weather_code}
+ > ) }; \ No newline at end of file diff --git a/public/clearNight.svg b/public/clearNight.svg deleted file mode 100644 index b19b5c3..0000000 --- a/public/clearNight.svg +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/public/clearNightColor.svg b/public/clearNightColor.svg deleted file mode 100644 index 3bacbac..0000000 --- a/public/clearNightColor.svg +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/public/cloud-and-lightening.svg b/public/cloud-and-lightening.svg new file mode 100644 index 0000000..b86c9e1 --- /dev/null +++ b/public/cloud-and-lightening.svg @@ -0,0 +1,27 @@ + + + diff --git a/public/cloud-and-moon.svg b/public/cloud-and-moon.svg new file mode 100644 index 0000000..4f969b9 --- /dev/null +++ b/public/cloud-and-moon.svg @@ -0,0 +1,23 @@ + + + diff --git a/public/cloud-and-rain.svg b/public/cloud-and-rain.svg new file mode 100644 index 0000000..4035834 --- /dev/null +++ b/public/cloud-and-rain.svg @@ -0,0 +1,29 @@ + + + diff --git a/public/cloud-and-snow.svg b/public/cloud-and-snow.svg new file mode 100644 index 0000000..fe4824c --- /dev/null +++ b/public/cloud-and-snow.svg @@ -0,0 +1,34 @@ + + + diff --git a/public/cloud-and-sun.svg b/public/cloud-and-sun.svg new file mode 100644 index 0000000..5a014fd --- /dev/null +++ b/public/cloud-and-sun.svg @@ -0,0 +1,33 @@ + + + diff --git a/public/cloud-and-wind.svg b/public/cloud-and-wind.svg new file mode 100644 index 0000000..9a873e3 --- /dev/null +++ b/public/cloud-and-wind.svg @@ -0,0 +1,30 @@ + + + diff --git a/public/cloud-snow-rain.svg b/public/cloud-snow-rain.svg new file mode 100644 index 0000000..b40010d --- /dev/null +++ b/public/cloud-snow-rain.svg @@ -0,0 +1,35 @@ + + + diff --git a/public/cloud-wind-rain.svg b/public/cloud-wind-rain.svg new file mode 100644 index 0000000..9f29f03 --- /dev/null +++ b/public/cloud-wind-rain.svg @@ -0,0 +1,40 @@ + + + diff --git a/public/cloud.svg b/public/cloud.svg new file mode 100644 index 0000000..f6ad570 --- /dev/null +++ b/public/cloud.svg @@ -0,0 +1,19 @@ + + + diff --git a/public/cloudy.svg b/public/cloudy.svg deleted file mode 100644 index 6104995..0000000 --- a/public/cloudy.svg +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/public/cloudyColor.svg b/public/cloudyColor.svg deleted file mode 100644 index 51bd3d5..0000000 --- a/public/cloudyColor.svg +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/public/moon.svg b/public/moon.svg new file mode 100644 index 0000000..ceb7e72 --- /dev/null +++ b/public/moon.svg @@ -0,0 +1,10 @@ + + + diff --git a/public/sun.svg b/public/sun.svg new file mode 100644 index 0000000..68c367f --- /dev/null +++ b/public/sun.svg @@ -0,0 +1,27 @@ + + + diff --git a/public/sunny.svg b/public/sunny.svg deleted file mode 100644 index 9b265aa..0000000 --- a/public/sunny.svg +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/public/wind-and-rain.svg b/public/wind-and-rain.svg new file mode 100644 index 0000000..06f3d83 --- /dev/null +++ b/public/wind-and-rain.svg @@ -0,0 +1,27 @@ + + +