Focus input on submission and fix scroll (#441)

This commit is contained in:
Jeremy 2024-10-14 23:01:46 +05:30 committed by GitHub
parent 23660c5ad1
commit 2705d83d6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 8 deletions

View file

@ -197,6 +197,10 @@ const SAMPLE = {
},
};
function n(num: number): number {
return Math.ceil(num);
}
export function Weather({
weatherAtLocation = SAMPLE,
}: {
@ -270,12 +274,12 @@ export function Weather({
)}
/>
<div className="text-4xl font-medium text-blue-50">
{weatherAtLocation.current.temperature_2m}
{n(weatherAtLocation.current.temperature_2m)}
{weatherAtLocation.current_units.temperature_2m}
</div>
</div>
<div className="text-blue-50">{`H:${currentHigh}° L:${currentLow}°`}</div>
<div className="text-blue-50">{`H:${n(currentHigh)}° L:${n(currentLow)}°`}</div>
</div>
<div className="flex flex-row justify-between">
@ -296,7 +300,7 @@ export function Weather({
)}
/>
<div className="text-blue-50 text-sm">
{displayTemperatures[index]}
{n(displayTemperatures[index])}
{weatherAtLocation.hourly_units.temperature_2m}
</div>
</div>