新修改

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

View File

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