mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08:00
hide name when collapsed
This commit is contained in:
parent
97789a8858
commit
cad0fa05e5
@ -72,6 +72,13 @@ export default class TopLeftMenuButton extends React.Component {
|
||||
const fallbackUserId = MatrixClientPeg.get().getUserId();
|
||||
const profileInfo = this.state.profileInfo;
|
||||
const name = profileInfo ? profileInfo.name : fallbackUserId;
|
||||
let nameElement;
|
||||
if (!this.props.collapsed) {
|
||||
nameElement = <div className="mx_TopLeftMenuButton_name">
|
||||
{ name }
|
||||
</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<AccessibleButton className="mx_TopLeftMenuButton" onClick={this.onToggleMenu}>
|
||||
<BaseAvatar
|
||||
@ -82,9 +89,7 @@ export default class TopLeftMenuButton extends React.Component {
|
||||
height={AVATAR_SIZE}
|
||||
resizeMethod="crop"
|
||||
/>
|
||||
<div className="mx_TopLeftMenuButton_name">
|
||||
{ name }
|
||||
</div>
|
||||
{ nameElement }
|
||||
<img className="mx_TopLeftMenuButton_chevron" src="img/topleft-chevron.svg" width="11" height="6" />
|
||||
</AccessibleButton>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user