Skip to content

Commit

Permalink
fix: 文字过长时头像被挤压
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Mar 10, 2023
1 parent ed4ff67 commit 07b92d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/components/common/UserAvatar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const userInfo = computed(() => userStore.userInfo)
</script>

<template>
<div class="flex items-center">
<div class="w-10 h-10 overflow-hidden rounded-full">
<div class="flex items-center overflow-hidden">
<div class="w-10 h-10 overflow-hidden rounded-full shrink-0">
<template v-if="isString(userInfo.avatar) && userInfo.avatar.length > 0">
<NAvatar
size="large"
Expand All @@ -25,11 +25,11 @@ const userInfo = computed(() => userStore.userInfo)
<NAvatar size="large" round :src="defaultAvatar" />
</template>
</div>
<div class="ml-2">
<h2 class="font-bold text-md">
<div class="flex-1 min-w-0 ml-2">
<h2 class="overflow-hidden font-bold text-md text-ellipsis whitespace-nowrap">
{{ userInfo.name ?? 'ChenZhaoYu' }}
</h2>
<p class="text-xs text-gray-500">
<p class="overflow-hidden text-xs text-gray-500 text-ellipsis whitespace-nowrap">
<span
v-if="isString(userInfo.description) && userInfo.description !== ''"
v-html="userInfo.description"
Expand Down
5 changes: 3 additions & 2 deletions src/views/chat/layout/sider/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const show = ref(false)

<template>
<footer class="flex items-center justify-between min-w-0 p-4 overflow-hidden border-t dark:border-neutral-800">
<UserAvatar />

<div class="flex-1 flex-shrink-0 overflow-hidden">
<UserAvatar />
</div>
<HoverButton :tooltip="$t('setting.setting')" @click="show = true">
<span class="text-xl text-[#4f555e] dark:text-white">
<SvgIcon icon="ri:settings-4-line" />
Expand Down

0 comments on commit 07b92d4

Please sign in to comment.