mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-21 20:39:36 +02:00
Dynamic WeatherIcon with weatherStatusCode mapping
This commit is contained in:
parent
e293325da7
commit
873faa6c97
4 changed files with 381 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue