summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-15 14:55:33 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-15 14:55:33 +0200
commitd6d275ee9427c5fbb3161f66cc5ac1c723a784d8 (patch)
treec6c5111b30b4517b36b34e2fd73df6fe28c14427
parent14a6435e80c2b0a87c490dc0af95123d1fa442eb (diff)
Show first letter of the username as avatar
Used only for empty avatars
-rw-r--r--components/VHeader.vue3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/VHeader.vue b/components/VHeader.vue
index be1e2af..cf06af2 100644
--- a/components/VHeader.vue
+++ b/components/VHeader.vue
@@ -28,7 +28,8 @@
@click="boxUserInfo = !boxUserInfo"
)
span.sr-only Open user menu
- img.h-8.w-8.rounded-full(v-if="me" :src="baseAPI+''+me.avatar" alt="Avatar")
+ img.h-8.w-8.rounded-full(v-if="me && me.avatar" :src="baseAPI+''+me.avatar" alt="Avatar")
+ span.h-8.w-8.rounded-full.bg-white.pt-1(v-else-if="me") {{ me.username[0] }}
.absolute.right-0.z-10.mt-2.w-48.origin-top-right.rounded-md.bg-white.py-1.shadow-lg.ring-1.ring-black.ring-opacity-5(class="focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" tabindex="-1" v-if="boxUserInfo && me")
a#user-menu-item-0.block.px-4.py-2.text-sm.text-gray-700(:href="'/user/'+me.id" role="menuitem" tabindex="-1") Your Profile
a#user-menu-item-1.block.px-4.py-2.text-sm.text-gray-700(href="#" role="menuitem" tabindex="-1") Settings