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:
parent
d257fbf9a3
commit
f137498e7e
16 changed files with 121 additions and 59 deletions
12
client/src/components/Home/functions/greeter.ts
Normal file
12
client/src/components/Home/functions/greeter.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue