mirror of
https://github.com/pawelmalak/flame.git
synced 2026-03-10 06:23:11 +08:00
Dynamic WeatherIcon with weatherStatusCode mapping
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user