diff --git a/src/client/pages/Dashboard/WelcomHeading.tsx b/src/client/pages/Dashboard/WelcomHeading.tsx index 20573ae92..10641618a 100644 --- a/src/client/pages/Dashboard/WelcomHeading.tsx +++ b/src/client/pages/Dashboard/WelcomHeading.tsx @@ -1,13 +1,42 @@ +import styles from './WelcomeHeading.module.scss'; import { ProfileName } from '../../components/MainHeader/ProfileName'; import { PageHeadingV2 } from '../../components/PageHeading/PageHeadingV2'; const HELLO = 'Welkom,'; +const NOON = 12; +const EVENING = 18; +const NIGHT = 5; export function WelcomeHeading() { + const hours = new Date().getHours(); + const isMorning = hours < NOON && hours >= NIGHT; + const isEvening = hours >= EVENING; + const isNight = hours < NIGHT; + const isAfternoon = hours >= NOON && hours < EVENING; + + let hello = HELLO; + + switch (true) { + case isMorning: + hello = 'Goedemorgen,'; + break; + case isAfternoon: + hello = 'Goedemiddag,'; + break; + case isEvening: + hello = 'Goedenavond,'; + break; + case isNight: + hello = 'Goedenacht,'; + break; + } + return ( - {HELLO} -
+ {hello}{' '} + + +
); } diff --git a/src/client/pages/Dashboard/WelcomeHeading.module.scss b/src/client/pages/Dashboard/WelcomeHeading.module.scss index e69de29bb..480c26236 100644 --- a/src/client/pages/Dashboard/WelcomeHeading.module.scss +++ b/src/client/pages/Dashboard/WelcomeHeading.module.scss @@ -0,0 +1,3 @@ +.ProfileNameWrap { + white-space: nowrap; +}