Add automatic IP-based weather detection to a new sidebar widget

Introduces a `SidebarWeatherWidget` component that displays localized weather information using IP address for location detection, removing the need for explicit user permission. The widget is placed in the homepage sidebar below the "Zuletzt hinzugefügt" section.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: fbb31221-fc0e-43bb-bb7c-88ad38d97042
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic
2026-03-02 17:02:16 +00:00
parent e0a9faf61c
commit 1fecc39035
2 changed files with 121 additions and 14 deletions
+3 -2
View File
@@ -12,7 +12,7 @@ import { PhotoGalleryWidget } from "@/components/photo-gallery";
import { HoroscopeWidget } from "@/components/horoscope-widget";
import { RecipeWidget } from "@/components/recipe-widget";
import { NewsWidget } from "@/components/news-widget";
import { WeatherWidget } from "@/components/weather-widget";
import { WeatherWidget, SidebarWeatherWidget } from "@/components/weather-widget";
import { BreakingNewsWidget } from "@/components/breaking-news-widget";
import { useState, useEffect, useCallback, useRef, useMemo } from "react";
@@ -587,8 +587,9 @@ export default function Home() {
</div>
)}
</div>
<div className="lg:col-span-1">
<div className="lg:col-span-1 space-y-4">
{articles && articles.length > 0 && <TopStoriesList articles={[...articles].sort((a, b) => new Date(b.publishedAt).getTime() - new Date(a.publishedAt).getTime()).slice(0, 5)} />}
<SidebarWeatherWidget />
<SidebarAd />
</div>
</div>