fix(ui): correct avatar decoration position in profile modal
AvatarPresence had position:absolute via UserAvatarContainer, which made it position relative to the AvatarDecoration wrapper (a new stacking context) instead of the hero container, shifting the decoration image one avatar-width to the left. Fix: apply UserAvatarContainer to an outer div so AvatarDecoration sits inside the absolute-positioned slot, not the other way around. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,29 +48,30 @@ export function UserHero({ userId, avatarUrl, presence }: UserHeroProps) {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className={css.UserHeroAvatarContainer}>
|
<div className={css.UserHeroAvatarContainer}>
|
||||||
<AvatarDecoration userId={userId} inset={20}>
|
<div className={css.UserAvatarContainer}>
|
||||||
<AvatarPresence
|
<AvatarDecoration userId={userId} inset={20}>
|
||||||
className={css.UserAvatarContainer}
|
<AvatarPresence
|
||||||
badge={
|
badge={
|
||||||
presence && <PresenceBadge presence={presence.presence} status={presence.status} />
|
presence && <PresenceBadge presence={presence.presence} status={presence.status} />
|
||||||
}
|
}
|
||||||
>
|
|
||||||
<Avatar
|
|
||||||
as={avatarUrl ? 'button' : 'div'}
|
|
||||||
onClick={avatarUrl ? () => setViewAvatar(avatarUrl) : undefined}
|
|
||||||
className={css.UserHeroAvatar}
|
|
||||||
size="500"
|
|
||||||
>
|
>
|
||||||
<UserAvatar
|
<Avatar
|
||||||
className={css.UserHeroAvatarImg}
|
as={avatarUrl ? 'button' : 'div'}
|
||||||
userId={userId}
|
onClick={avatarUrl ? () => setViewAvatar(avatarUrl) : undefined}
|
||||||
src={avatarUrl}
|
className={css.UserHeroAvatar}
|
||||||
alt={userId}
|
size="500"
|
||||||
renderFallback={() => <Icon size="500" src={Icons.User} filled />}
|
>
|
||||||
/>
|
<UserAvatar
|
||||||
</Avatar>
|
className={css.UserHeroAvatarImg}
|
||||||
</AvatarPresence>
|
userId={userId}
|
||||||
</AvatarDecoration>
|
src={avatarUrl}
|
||||||
|
alt={userId}
|
||||||
|
renderFallback={() => <Icon size="500" src={Icons.User} filled />}
|
||||||
|
/>
|
||||||
|
</Avatar>
|
||||||
|
</AvatarPresence>
|
||||||
|
</AvatarDecoration>
|
||||||
|
</div>
|
||||||
{viewAvatar && (
|
{viewAvatar && (
|
||||||
<Overlay open backdrop={<OverlayBackdrop />}>
|
<Overlay open backdrop={<OverlayBackdrop />}>
|
||||||
<OverlayCenter>
|
<OverlayCenter>
|
||||||
|
|||||||
Reference in New Issue
Block a user