Dynamic WeatherIcon with weatherStatusCode mapping

This commit is contained in:
unknown
2021-05-15 18:05:53 +02:00
parent e293325da7
commit 873faa6c97
4 changed files with 381 additions and 11 deletions

View File

@@ -48,10 +48,10 @@ const Home = (props: ComponentProps): JSX.Element => {
const now = new Date().getHours();
let msg: string;
if (now > 18) msg = 'Good evening!';
else if (now > 12) msg = 'Good afternoon!';
else if (now > 6) msg = 'Good morning!';
else if (now > 0) msg = 'Good night!';
if (now >= 18) msg = 'Good evening!';
else if (now >= 12) msg = 'Good afternoon!';
else if (now >= 6) msg = 'Good morning!';
else if (now >= 0) msg = 'Good night!';
else msg = 'Hello!';
return msg;