Skip to content

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

Merged
merged 11 commits into from
Apr 8, 2021

Conversation

M-i-k-e-l
Copy link
Collaborator

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)

@@ -43,6 +43,19 @@ export function getInitials(name: string) {
return _.toUpper(initials);
}

export function getBackgroundColor(name?: string,
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (found a bug!)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The power of testings (:

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar April 7, 2021 14:32
* Hash the name (or label) to get a color, so each name will have a specific color.
* Default is false.
*/
useAutoColorsConfig?: boolean;
Copy link
Collaborator

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

Suggested change
useAutoColorsConfig?: boolean;
useAutoColors?: boolean;

Copy link
Collaborator Author

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The power of testings (:

@ethanshar
Copy link
Collaborator

Looks great!
Last small fixes (:

@M-i-k-e-l M-i-k-e-l requested a review from ethanshar April 8, 2021 13:06
@ethanshar ethanshar merged commit 36b1795 into master Apr 8, 2021
@M-i-k-e-l M-i-k-e-l deleted the feat/avatar-add-name-with-initials-and-bg-color branch October 4, 2021 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants