Skip to content

Commit fc1df53

Browse files
feat(multi-org): Show user icon when FirstName and LastName are absent (#5494)
1 parent d1bae61 commit fc1df53

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/identity/components/GlobalHeader/IdentityUserAvatar.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,17 @@ class IdentityUserAvatar extends React.Component<Props, State> {
100100
<div>
101101
{/* Button shape is ButtonShape.Square to make the height and width the same
102102
so we can use the border radius to make it a circle */}
103-
{this.getInitials() && (
104-
<Button
105-
text={this.getInitials()}
106-
shape={ButtonShape.Square}
107-
color={
108-
isPopoverOpen ? ComponentColor.Default : ComponentColor.Tertiary
109-
}
110-
onClick={this.togglePopoverState}
111-
className={userAvatarButtonClassName}
112-
testID="global-header--user-avatar"
113-
/>
114-
)}
103+
<Button
104+
text={this.getInitials()}
105+
shape={ButtonShape.Square}
106+
color={
107+
isPopoverOpen ? ComponentColor.Default : ComponentColor.Tertiary
108+
}
109+
onClick={this.togglePopoverState}
110+
className={userAvatarButtonClassName}
111+
testID="global-header--user-avatar"
112+
icon={!this.getInitials() ? IconFont.User : null}
113+
/>
115114
<FlexBox
116115
className={userPopoverClassName}
117116
direction={FlexDirection.Column}

src/identity/components/GlobalHeader/UserPopoverStyles.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
border: none;
1111
background: linear-gradient(75.66deg, #0098f0 0%, $c-amethyst 79.64%);
1212
}
13+
.cf-button-icon {
14+
font-size: 18px;
15+
}
1316
}
1417

1518
.user-popover {

0 commit comments

Comments
 (0)