Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): profile name gets cut off by roles #2915

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/account/AccountHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ async function copyAccountName() {
<div flex="~ col gap1" pt2>
<div flex gap2 items-center flex-wrap>
<AccountDisplayName :account="account" font-bold sm:text-2xl text-xl />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" />
<AccountLockIndicator v-if="account.locked" show-label />
<AccountBotIndicator v-if="account.bot" show-label />
</div>
Expand All @@ -202,6 +201,9 @@ async function copyAccountName() {
</button>
</CommonTooltip>
</div>
<div self-start mt-1>
<AccountRolesIndicator v-if="account.roles?.length" :account="account" />
</div>
</div>
</div>
<label
Expand Down
2 changes: 1 addition & 1 deletion components/account/AccountHoverCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const relationship = useRelationship(account)
<div v-show="relationship" flex="~ col gap2" rounded min-w-90 max-w-120 z-100 overflow-hidden p-4>
<div flex="~ gap2" items-center>
<NuxtLink :to="getAccountRoute(account)" flex-auto rounded-full hover:bg-active transition-100 pe5 me-a>
<AccountInfo :account="account" />
<AccountInfo :account="account" :hover-card="true" />
</NuxtLink>
<AccountFollowButton text-sm :account="account" :relationship="relationship" />
</div>
Expand Down
8 changes: 5 additions & 3 deletions components/account/AccountInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ const { account, as = 'div' } = defineProps<{
<!-- TODO: Make this work for both buttons and links -->
<!-- This is sometimes (like in the sidebar) used directly as a button, and sometimes, like in follow notifications, as a link. I think this component may need a second refactor that either lets an implementation pass in a link or an action and adapt to what's passed in, or the implementations need to be updated to wrap in the action they want to take and this be just the layout for these items -->
<template>
<component :is="as" flex gap-3 v-bind="$attrs">
<component :is="as" flex items-center gap-3 v-bind="$attrs">
<AccountHoverWrapper :disabled="!hoverCard" :account="account">
<AccountBigAvatar :account="account" shrink-0 :square="square" />
</AccountHoverWrapper>
<div flex="~ col" shrink pt-1 h-full overflow-hidden justify-center leading-none select-none>
<div flex="~ col" shrink h-full overflow-hidden justify-center leading-none select-none p-1>
<div flex="~" gap-2>
<AccountDisplayName :account="account" font-bold line-clamp-1 ws-pre-wrap break-all text-lg />
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
<AccountLockIndicator v-if="account.locked" text-xs />
<AccountBotIndicator v-if="account.bot" text-xs />
</div>
<AccountHandle :account="account" text-secondary-light />
<div self-start mt-1>
<AccountRolesIndicator v-if="account.roles?.length" :account="account" :limit="1" />
</div>
</div>
</component>
</template>