feat: Add user profile avatar (#9298)

* feat: add avatar

* chore: add more colors

* chore: add helpers

* chore: build prettier issues

* chore: refactor shouldShowImage

* chore: code cleanup

* Update app/javascript/v3/components/Form/InitialsAvatar.vue

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>

* chore: revire comments

---------

Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com>
This commit is contained in:
Muhsin Keloth
2024-04-26 16:02:10 +05:30
committed by GitHub
parent 47f8b2cd0c
commit d88d0bdd80
7 changed files with 638 additions and 171 deletions

View File

@@ -1,3 +1,9 @@
export const replaceRouteWithReload = url => {
window.location = url;
};
export const userInitial = name => {
const parts = name.split(/[ -]/).filter(Boolean);
let initials = parts.map(part => part[0].toUpperCase()).join('');
return initials.slice(0, 2);
};