feat: add temperature unit preference
This commit is contained in:
@@ -17,6 +17,7 @@ export function StationCard({ station, index = 0 }: { station: SynopStation; ind
|
||||
const favorites = useWeatherStore((state) => state.favorites);
|
||||
const toggleFavorite = useWeatherStore((state) => state.toggleFavorite);
|
||||
const selectStation = useWeatherStore((state) => state.selectStation);
|
||||
const temperatureUnit = useWeatherStore((state) => state.temperatureUnit);
|
||||
const windSpeedUnit = useWeatherStore((state) => state.windSpeedUnit);
|
||||
const favorite = favorites.includes(station.id);
|
||||
const mood = getWeatherMoodFromData(station);
|
||||
@@ -27,7 +28,7 @@ export function StationCard({ station, index = 0 }: { station: SynopStation; ind
|
||||
<div className="flex items-start justify-between gap-2">
|
||||
<Link href={`/station/${station.id}`} onClick={() => selectStation(station.id)} className="min-w-0 flex-1 rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent">
|
||||
<p className="truncate text-sm font-semibold">{station.name}</p>
|
||||
<p className="mt-3 text-4xl font-light tracking-[-0.08em]">{formatTemperature(station.temperature, language)}</p>
|
||||
<p className="mt-3 text-4xl font-light tracking-[-0.08em]">{formatTemperature(station.temperature, language, temperatureUnit)}</p>
|
||||
</Link>
|
||||
<div className="flex flex-col items-end gap-2">
|
||||
<WeatherIcon mood={mood} className="size-9 text-accent" />
|
||||
|
||||
Reference in New Issue
Block a user