[Backport staging] Fix misaligned display name on desktop (#33626)

Co-authored-by: David Baker <dbkr@users.noreply.github.com>
This commit is contained in:
ElementRobot
2026-05-27 08:23:40 +01:00
committed by GitHub
co-authored by David Baker
parent 1120bf30b8
commit d5038119e5
2 changed files with 5 additions and 5 deletions
@@ -7,13 +7,13 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
class="mx_SpacePanel collapsed newUi" class="mx_SpacePanel collapsed newUi"
> >
<div <div
class="_wrapper_1yvpq_8" class="_wrapper_1yvpq_8 mx_UserMenu"
> >
<button <button
aria-expanded="false" aria-expanded="false"
aria-haspopup="menu" aria-haspopup="menu"
aria-label="User menu" aria-label="User menu"
class="_triggerButton_1yvpq_57 mx_UserMenu" class="_triggerButton_1yvpq_57"
data-state="closed" data-state="closed"
id="radix-_r_0_" id="radix-_r_0_"
type="button" type="button"
@@ -102,7 +102,7 @@ export declare interface UserMenuViewActions {
export type UserMenuViewProps = { export type UserMenuViewProps = {
vm: ViewModel<UserMenuViewSnapshot, UserMenuViewActions>; vm: ViewModel<UserMenuViewSnapshot, UserMenuViewActions>;
/** /**
* Class name for the trigger * Class name for the wrapper
*/ */
className?: string; className?: string;
}; };
@@ -111,7 +111,7 @@ export function UserMenuView({ vm, className }: UserMenuViewProps): JSX.Element
const { userId, displayName, avatarUrl, expanded, open, manageAccountHref, actions, showAvatar } = useViewModel(vm); const { userId, displayName, avatarUrl, expanded, open, manageAccountHref, actions, showAvatar } = useViewModel(vm);
const { translate: _t } = useI18n(); const { translate: _t } = useI18n();
const trigger = ( const trigger = (
<button className={classNames(styles.triggerButton, className)} aria-label={_t("menus|user_menu|title")}> <button className={styles.triggerButton} aria-label={_t("menus|user_menu|title")}>
<Avatar id={userId} name={displayName} type="round" size="36px" src={avatarUrl} /> <Avatar id={userId} name={displayName} type="round" size="36px" src={avatarUrl} />
</button> </button>
); );
@@ -119,7 +119,7 @@ export function UserMenuView({ vm, className }: UserMenuViewProps): JSX.Element
// The menu should appear to the right of the avatar, over the displayname if the menu is expanded, // The menu should appear to the right of the avatar, over the displayname if the menu is expanded,
// so the display name goes outside the menu block in a wrapper. // so the display name goes outside the menu block in a wrapper.
return ( return (
<div className={styles.wrapper}> <div className={classNames(styles.wrapper, className)}>
<Menu <Menu
open={open} open={open}
showTitle={false} showTitle={false}