Skip to content

Commit

Permalink
fix bug when temp is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
hanshack committed Nov 28, 2023
1 parent f929ae4 commit 7ade966
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/components/WeatherOverlay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,13 @@ export const WeatherRow: FC<WeatherRowPropType> = ({
<span className="">{ICON_MAPPING[weatherRecords[hour].icon]}</span>
</div>
)}
{weatherRecords[hour] && weatherRecords[hour].temperature && (
<div className="my-auto text-xs sm:text-lg font-bold text-lightblue/90 ml-auto sm:mr-1 w-12 sm:w-14">
{/* @ts-ignore */}
{Math.round(weatherRecords[hour].temperature)} °C
</div>
)}
{weatherRecords[hour] &&
weatherRecords[hour].temperature !== undefined && (
<div className="my-auto text-xs sm:text-lg font-bold text-lightblue/90 ml-auto sm:mr-1 w-12 sm:w-14">
{/* @ts-ignore */}
{Math.round(weatherRecords[hour].temperature)} °C
</div>
)}
</div>
)
}
Expand Down

0 comments on commit 7ade966

Please sign in to comment.