improve home page & account footer
This commit is contained in:
parent
af078e7ba2
commit
6b2d0f5cbc
23 changed files with 551 additions and 36 deletions
|
|
@ -11,3 +11,17 @@ export type WithoutChild<T> = T extends { child?: any } ? Omit<T, "child"> : T;
|
|||
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, "children"> : T;
|
||||
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
|
||||
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & { ref?: U | null };
|
||||
|
||||
export function getTimeBasedGreeting(name: string): string {
|
||||
const hour = new Date().getHours();
|
||||
|
||||
if (hour < 12) {
|
||||
return `Good morning, ${name}`;
|
||||
} else if (hour < 17) {
|
||||
return `Good afternoon, ${name}`;
|
||||
} else if (hour < 22) {
|
||||
return `Good evening, ${name}`;
|
||||
} else {
|
||||
return `Good night, ${name}`;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue