-
Notifications
You must be signed in to change notification settings - Fork 734
Avatar - add name with initials and backgroundColor specific to that name #1239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avatar - add name with initials and backgroundColor specific to that name #1239
Conversation
@@ -43,6 +43,19 @@ export function getInitials(name: string) { | |||
return _.toUpper(initials); | |||
} | |||
|
|||
export function getBackgroundColor(name?: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding few simple tests to cover the new functionalities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done (found a bug!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The power of testings (:
* Hash the name (or label) to get a color, so each name will have a specific color. | ||
* Default is false. | ||
*/ | ||
useAutoColorsConfig?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useAutoColorsConfig
sounds like the user must pass it. I think useAutoColors
is better
useAutoColorsConfig?: boolean; | |
useAutoColors?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -43,6 +43,19 @@ export function getInitials(name: string) { | |||
return _.toUpper(initials); | |||
} | |||
|
|||
export function getBackgroundColor(name?: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The power of testings (:
Looks great! |
Description
Avatar - add name with initials and backgroundColor specific to that name (i.e. hash)
Changelog
Avatar - add name with initials and backgroundColor specific to that name (i.e. hash)