From e766728c5f213c4703e4f5e961585b9fa38f8463 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Thu, 23 Apr 2026 00:57:49 +0800 Subject: [PATCH] Refine homepage focus panel --- frontend/components/dashboard/CitySidebar.tsx | 8 +- .../components/dashboard/Dashboard.module.css | 201 +++++++++++++++ .../dashboard/PolyWeatherDashboard.tsx | 242 ++++++++++++++++-- frontend/lib/dashboard-home-copy.ts | 164 ++++++++++++ 4 files changed, 597 insertions(+), 18 deletions(-) create mode 100644 frontend/lib/dashboard-home-copy.ts diff --git a/frontend/components/dashboard/CitySidebar.tsx b/frontend/components/dashboard/CitySidebar.tsx index 34ee1219..5f1e9e5d 100644 --- a/frontend/components/dashboard/CitySidebar.tsx +++ b/frontend/components/dashboard/CitySidebar.tsx @@ -5,6 +5,7 @@ import clsx from "clsx"; import { Clock } from "lucide-react"; import { useDashboardStore } from "@/hooks/useDashboardStore"; import { useI18n } from "@/hooks/useI18n"; +import { getLocalizedCityName } from "@/lib/dashboard-home-copy"; import { CityListItem, DeviationMonitor } from "@/lib/dashboard-types"; type RiskGroupKey = "high" | "medium" | "low" | "other"; @@ -211,6 +212,11 @@ export function CitySidebar() { const detail = store.cityDetailsByName[city.name]; const summary = store.citySummariesByName[city.name]; const snapshot = detail || summary; + const localizedCityName = getLocalizedCityName( + city.name, + snapshot?.display_name || city.display_name, + locale, + ); const isActive = store.selectedCity === city.name; const tempSymbol = snapshot?.temp_symbol || "°C"; const currentTempText = @@ -258,7 +264,7 @@ export function CitySidebar() {