From dcfbbb2f2273d0aaf5115bd7956e2f4f9aa838fa Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Tue, 29 Jul 2025 23:40:24 +0200 Subject: [PATCH] feat: enhance weather fetching experience with loading state and notifications --- frontend/src/Layout/Layout.tsx | 10 ++++++++-- frontend/src/components/ChangeAPI.tsx | 12 ++++++++++-- frontend/src/components/Header.tsx | 2 +- frontend/src/components/IsLoading.tsx | 15 +++++++++++++++ frontend/src/components/WeatherCard.tsx | 14 ++++++++++++-- frontend/src/utils/apiFunc.ts | 4 ---- frontend/src/utils/toastify.ts | 2 +- 7 files changed, 47 insertions(+), 12 deletions(-) create mode 100644 frontend/src/components/IsLoading.tsx diff --git a/frontend/src/Layout/Layout.tsx b/frontend/src/Layout/Layout.tsx index a091440..211ff77 100644 --- a/frontend/src/Layout/Layout.tsx +++ b/frontend/src/Layout/Layout.tsx @@ -13,8 +13,14 @@ const Layout: React.FC = ({ children }) => {
{children}
diff --git a/frontend/src/components/ChangeAPI.tsx b/frontend/src/components/ChangeAPI.tsx index 5d6daa4..464bcc8 100644 --- a/frontend/src/components/ChangeAPI.tsx +++ b/frontend/src/components/ChangeAPI.tsx @@ -1,11 +1,12 @@ import { useState } from "react"; +import React from "react"; import { changeAPIcookie } from "../utils/changeAPIcookie"; interface Props { currentAPIKey: string; } -function ChangeAPI({ currentAPIKey }: Props) { +const ChangeAPI: React.FC = ({ currentAPIKey }) => { const [apiKey, setApiKey] = useState(currentAPIKey); return ( @@ -14,6 +15,13 @@ function ChangeAPI({ currentAPIKey }: Props) {

Update your API key to fetch weather data.

+

+ We are using{" "} + + OpenWeatherMap + {" "} + API for fetching weather data. +