diff --git a/front/src/components/common/ActorAvatar.vue b/front/src/components/common/ActorAvatar.vue index b1834a959..cc4da38a1 100644 --- a/front/src/components/common/ActorAvatar.vue +++ b/front/src/components/common/ActorAvatar.vue @@ -19,16 +19,18 @@ const defaultAvatarStyle = computed(() => ({ backgroundColor: `#${actorColor.val v-if="actor.icon && actor.icon.urls.original" alt="" :src="actor.icon.urls.medium_square_crop" - class="ui avatar circular image" + class="ui tiny avatar circular image" > - {{ actor.preferred_username?.[0] || "" }} + class="ui tiny avatar circular label" + > + {{ actor.preferred_username?.[0] || "" }} + - diff --git a/front/src/components/common/UserLink.vue b/front/src/components/common/UserLink.vue index 2a833b7ba..4420dd05f 100644 --- a/front/src/components/common/UserLink.vue +++ b/front/src/components/common/UserLink.vue @@ -6,16 +6,20 @@ import { computed } from 'vue' import { useI18n } from 'vue-i18n' import { useStore } from '~/store' +import Link from '~/components/ui/Link.vue' + interface Props { user: User avatar?: boolean + discrete?: boolean } const store = useStore() const { t } = useI18n() const props = withDefaults(defineProps(), { - avatar: true + avatar: true, + discrete: false }) const userColor = computed(() => intToRGB(hashCode(props.user.username + props.user.id))) @@ -23,21 +27,40 @@ const defaultAvatarStyle = computed(() => ({ backgroundColor: `#${userColor.valu + + diff --git a/front/src/style/components/_avatar.scss b/front/src/style/components/_avatar.scss index 350937ce9..804f90ee9 100644 --- a/front/src/style/components/_avatar.scss +++ b/front/src/style/components/_avatar.scss @@ -1,12 +1,15 @@ - -.ui.tiny.avatar.image { - position: relative; - top: -0.5em; - width: 3em; -} - .ui.tiny.avatar { width: 28px; height: 28px; + display: block; + float: left; + text-align: center; font-size: 1em !important; + border-radius: 50%; + + &.label { + align-content: center; + padding: 4px 8px; + } + } diff --git a/front/src/ui/components/UserMenu.vue b/front/src/ui/components/UserMenu.vue index 611e33584..f9c37ec45 100644 --- a/front/src/ui/components/UserMenu.vue +++ b/front/src/ui/components/UserMenu.vue @@ -3,7 +3,6 @@ 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' @@ -24,9 +23,6 @@ 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'), @@ -53,6 +49,7 @@ const labels = computed(() => ({ round square-small ghost + class="user-menu" :ariaPressed="isOpen ? true : undefined" > ({ > {{ store.state.auth.profile?.full_username?.[0] || "" }} @@ -163,25 +159,48 @@ const labels = computed(() => ({ - diff --git a/front/src/views/auth/ProfileBase.vue b/front/src/views/auth/ProfileBase.vue index 14ca70646..03081412b 100644 --- a/front/src/views/auth/ProfileBase.vue +++ b/front/src/views/auth/ProfileBase.vue @@ -216,6 +216,8 @@ const recentActivity = ref(0) font-size: 100px; font-style: normal; font-weight: 800; + text-align: center; + align-content: center; background-color: var(--fw-gray-500); border-radius: 50%; width: 176px; diff --git a/front/src/views/content/remote/Card.vue b/front/src/views/content/remote/Card.vue index db908e03e..a4dc30f9d 100644 --- a/front/src/views/content/remote/Card.vue +++ b/front/src/views/content/remote/Card.vue @@ -256,7 +256,6 @@ const isOpen = ref(false)