diff --git a/front/src/components/common/ActorAvatar.vue b/front/src/components/common/ActorAvatar.vue index 815a6f348..f6222afa1 100644 --- a/front/src/components/common/ActorAvatar.vue +++ b/front/src/components/common/ActorAvatar.vue @@ -31,7 +31,6 @@ const defaultAvatarStyle = computed(() => ({ backgroundColor: `#${actorColor.val \ No newline at end of file + diff --git a/front/src/style/components/_avatar.scss b/front/src/style/components/_avatar.scss index f7c3506ef..350937ce9 100644 --- a/front/src/style/components/_avatar.scss +++ b/front/src/style/components/_avatar.scss @@ -5,7 +5,7 @@ width: 3em; } -.ui.circular.avatar { +.ui.tiny.avatar { width: 28px; height: 28px; font-size: 1em !important; diff --git a/front/src/ui/components/UserMenu.vue b/front/src/ui/components/UserMenu.vue index 87e46931b..611e33584 100644 --- a/front/src/ui/components/UserMenu.vue +++ b/front/src/ui/components/UserMenu.vue @@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n' import { computed, ref} from 'vue' import { useStore } from '~/store' import { useRoute } from 'vue-router' +import { hashCode, intToRGB } from '~/utils/color' import useThemeList from '~/composables/useThemeList' import useTheme from '~/composables/useTheme' @@ -23,6 +24,9 @@ const { theme } = useTheme() const isOpen = ref(false) +const actorColor = computed(() => intToRGB(hashCode(store.state.auth.profile.full_username))) +const defaultAvatarStyle = computed(() => ({ backgroundColor: `#${actorColor.value}` })) + const labels = computed(() => ({ profile: t('components.common.UserMenu.link.profile'), settings: t('components.common.UserMenu.link.settings'), @@ -57,6 +61,13 @@ const labels = computed(() => ({ :src="store.getters['instance/absoluteUrl'](store.state.auth.profile?.avatar.urls.medium_square_crop)" class="avatar" > + + {{ store.state.auth.profile?.full_username?.[0] || "" }} +