Focus input on submission and fix scroll (#441)
This commit is contained in:
parent
23660c5ad1
commit
2705d83d6c
5 changed files with 61 additions and 8 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue