From b74e807ada6796e1275b8e42bdb18c26c001b55e Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Thu, 25 Apr 2024 08:55:12 +0530 Subject: [PATCH] feat: complete avatar --- .../settings/personal/UserProfilePicture.vue | 99 ++------------- .../Form/{Avatar.vue => InitialsAvatar.vue} | 8 +- .../v3/components/Form/ProfileAvatar.vue | 120 ++++++++++++++++++ 3 files changed, 139 insertions(+), 88 deletions(-) rename app/javascript/v3/components/Form/{Avatar.vue => InitialsAvatar.vue} (77%) create mode 100644 app/javascript/v3/components/Form/ProfileAvatar.vue diff --git a/app/javascript/dashboard/routes/dashboard/settings/personal/UserProfilePicture.vue b/app/javascript/dashboard/routes/dashboard/settings/personal/UserProfilePicture.vue index 473fa093c..0fd372dc0 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/personal/UserProfilePicture.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/personal/UserProfilePicture.vue @@ -4,56 +4,19 @@ {{ $t('PROFILE_SETTINGS.FORM.PICTURE') }} -
- - - - - -
+ + diff --git a/app/javascript/v3/components/Form/Avatar.vue b/app/javascript/v3/components/Form/InitialsAvatar.vue similarity index 77% rename from app/javascript/v3/components/Form/Avatar.vue rename to app/javascript/v3/components/Form/InitialsAvatar.vue index 4d39b752d..9bdc1d9d2 100644 --- a/app/javascript/v3/components/Form/Avatar.vue +++ b/app/javascript/v3/components/Form/InitialsAvatar.vue @@ -15,6 +15,12 @@ import { computed } from 'vue'; const colors = { 1: 'bg-ash-200 text-ash-900', 2: 'bg-amber-200 text-amber-900', + 3: 'bg-pink-100 text-pink-800', + 4: 'bg-purple-100 text-purple-800', + 5: 'bg-indigo-100 text-indigo-800', + 6: 'bg-grass-100 text-grass-800', + 7: 'bg-mint-100 text-mint-800', + 8: 'bg-orange-100 text-orange-800', }; const props = defineProps({ @@ -33,7 +39,7 @@ const style = computed(() => ({ })); const colorClass = computed(() => { - return colors[(props.username.length % 2) + 1]; + return colors[(props.username.length % 8) + 1]; }); const userInitial = computed(() => { diff --git a/app/javascript/v3/components/Form/ProfileAvatar.vue b/app/javascript/v3/components/Form/ProfileAvatar.vue new file mode 100644 index 000000000..06c968d29 --- /dev/null +++ b/app/javascript/v3/components/Form/ProfileAvatar.vue @@ -0,0 +1,120 @@ + +