新修改

This commit is contained in:
jinsir 2025-11-14 18:51:33 +08:00
parent eafb9eeccb
commit 3b8cff7323
2 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
import { WeathersearchForm } from "./WeatherSearchForm.tsx";
import { WeatherDisplay } from "./WeatherDisplay.tsx";
import { WeatherDetailsGrid } from "./WeatherDetailsGrid.tsx";
import { useWeatherStore } from "./WeatherStore.tsx";
import { WeatherSearchForm } from "@/components/weather/WeatherSearchForm.tsx";
import { WeatherDisplay } from "@/components/weather/WeatherDisplay.tsx";
import { WeatherDetailsGrid } from "@/components/weather/WeatherDetailsGrid.tsx";
import { useWeatherStore } from "@/store/weatherStore.tsx";
import Cloud from "../../../assets/cloud.svg";
export function WeatherCard() {
@ -9,7 +9,7 @@ export function WeatherCard() {
return (
<div>
<WeathersearchForm />
<WeatherSearchForm />
{currentWeather ? (
<div className="P-4">
<WeatherDisplay />

View File

@ -1,7 +1,7 @@
import REACT, { use, useEffect } from 'react'
import { Loader2 } from 'lucide-react';
import { WeatherCard } from './WeatherCard'
import { useWeatherstore } from './WeatherStore'
import { WeatherCard } from '@/components/weather/WeatherCard'
import { useWeatherStore } from '@/store/weatherStore'
import { toast } from 'sonner'
@ -15,13 +15,13 @@ export function meta() {
}
export default function Weather() {
const { currentWeather, isLoading, error, seterror } = useWeatherstore()
const { currentWeather, isLoading, error, setError } = useWeatherStore()
useEffect(() => {
if (error) {
toast.error(error)
seterror("")
setError("")
}
}, [error, seterror])
}, [error, setError])
return (
<div className="flex flex-col items-center justify-center h-screen">