From 81578b2585eefc1349a397993a0551f9b864c156 Mon Sep 17 00:00:00 2001 From: Li1304553726 <1304553726@qq.com> Date: Mon, 17 Nov 2025 17:55:01 +0800 Subject: [PATCH] 1 --- app/components/WeatherDetailsGird.tsx | 52 +++++++++++++++++++++++++++ package.json | 44 ----------------------- 2 files changed, 52 insertions(+), 44 deletions(-) diff --git a/app/components/WeatherDetailsGird.tsx b/app/components/WeatherDetailsGird.tsx index 2287c34..6765d7e 100644 --- a/app/components/WeatherDetailsGird.tsx +++ b/app/components/WeatherDetailsGird.tsx @@ -1,3 +1,5 @@ +import { Cloud, Droplets, Gauge, ThermometerSun, Wind } from "lucide-react"; + interface WeatherDetailsGridProps { icon: React.ReactNode; label: string; @@ -5,3 +7,53 @@ interface WeatherDetailsGridProps { subtitle?: string; } +function WeatherInfoItem({ icon, label, value, subtitle }: WeatherDetailsGridProps) { + return( +
+
+
+ {icon} +
+
+

{label}

+

{value}

+ {subtitle &&

{subtitle}

} +
+
+
+ ) +} + +export function WeatherDetailsGrid(){ + const currentWeather = useWeatherState(); + if(!currentWeather) return null; + return( +
+
+ } label="湿度" value={`${currentWeather.current.humidity}%`} /> + } label="风速" value={`${currentWeather.current.wind_speed} m/s`} /> + } label="气压" value={`${currentWeather.current.pressure} hPa`} /> + } label="云量" value={`${currentWeather.current.cloudcover}%`} /> + } label="紫外线" value={`${currentWeather.current.uv_index} UV`} /> +
+
+
+
+ + 降水量:\ + + {currentWeather.current.precipitation} mm + + +
+ + {currentWeather.current.is_day === "yes" ? "白天" : "夜晚"} + +
+

+ 观测时间: {currentWeather.current.observation_time} +

+
+
+ ) +} \ No newline at end of file diff --git a/package.json b/package.json index b6e384f..653642a 100644 --- a/package.json +++ b/package.json @@ -8,37 +8,6 @@ "start": "react-router-serve ./build/server/index.js", "typecheck": "react-router typegen && tsc" }, - "dependencies": { - "@radix-ui/react-dialog": "^1.1.15", - "@radix-ui/react-label": "^2.1.8", - "@radix-ui/react-select": "^2.2.6", - "@radix-ui/react-slot": "^1.2.4", - "@react-router/node": "^7.9.2", - "@react-router/serve": "^7.9.2", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "isbot": "^5.1.31", - "lucide-react": "^0.554.0", - "next-themes": "^0.4.6", - "react": "^19.1.1", - "react-dom": "^19.1.1", -<<<<<<< HEAD - "react-router": "^7.9.2", - "sonner": "^2.0.7", - "tailwind-merge": "^3.4.0" -======= - "react-router": "^7.9.2" - },{ - "name": "1114", - "private": true, - "type": "module", - "scripts": { - "build": "react-router build", - "dev": "react-router dev", - "start": "react-router-serve ./build/server/index.js", - "typecheck": "react-router typegen && tsc" ->>>>>>> 9b018e3e43a44ed8f5b9d08e22c09de35b4ce874 - }, "dependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-label": "^2.1.8", @@ -75,16 +44,3 @@ "vite-tsconfig-paths": "^5.1.4" } } - "devDependencies": { - "@react-router/dev": "^7.9.2", - "@tailwindcss/vite": "^4.1.13", - "@types/node": "^22", - "@types/react": "^19.1.13", - "@types/react-dom": "^19.1.9", - "tailwindcss": "^4.1.13", - "tw-animate-css": "^1.4.0", - "typescript": "^5.9.2", - "vite": "^7.1.7", - "vite-tsconfig-paths": "^5.1.4" - } -} \ No newline at end of file