1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-20 03:59:36 +02:00

Added auto-refresh for greeting and date. Fixed multiple React warnings

This commit is contained in:
unknown 2021-06-13 01:06:42 +02:00
parent d257fbf9a3
commit f137498e7e
16 changed files with 121 additions and 59 deletions

View file

@ -0,0 +1,12 @@
export const greeter = (): string => {
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!';
else msg = 'Hello!';
return msg;
}