@@ -36,6 +36,7 @@ import { LogoutButton } from './log-out-button';
3636import { resolveTenantName } from '../configuration/utils/tenant-utils' ;
3737import { getShouldShowTenantPopup , setShouldShowTenantPopup } from '../../utils/storage-utils' ;
3838import { getDashboardsInfo } from '../../utils/dashboards-info-utils' ;
39+ import { LeftBottomActionButton } from '../../../../../src/core/public' ;
3940import './account-nav-button.scss' ;
4041
4142export function AccountNavButton ( props : {
@@ -173,15 +174,12 @@ export function AccountNavButton(props: {
173174
174175 // ToDo: Add aria-label and tooltip when isPlacedInLeftNav is true
175176 const innerElement = isPlacedInLeftNav ? (
176- < EuiButtonEmpty
177- size = "xs"
178- flush = "both"
179- className = "accountNavButton"
180- aria-expanded = { isPopoverOpen }
181- aria-haspopup = "true"
182- >
183- < EuiAvatar name = { username } size = "s" />
184- </ EuiButtonEmpty >
177+ < LeftBottomActionButton
178+ title = { username }
179+ icon = { < EuiAvatar name = { username } size = "s" /> }
180+ isNavDrawerLocked$ = { props . coreStart . chrome . getIsNavDrawerLocked$ ( ) }
181+ isChromeVisible$ = { props . coreStart . chrome . getIsVisible$ ( ) }
182+ />
185183 ) : (
186184 < EuiAvatar name = { username } size = "m" />
187185 ) ;
@@ -191,7 +189,6 @@ export function AccountNavButton(props: {
191189 < EuiPopover
192190 data-test-subj = "account-popover"
193191 id = "actionsMenu"
194- anchorPosition = { isPlacedInLeftNav ? 'rightDown' : undefined }
195192 button = { innerElement }
196193 isOpen = { isPopoverOpen }
197194 closePopover = { ( ) => {
@@ -201,6 +198,8 @@ export function AccountNavButton(props: {
201198 onClick = { ( ) => {
202199 setPopoverOpen ( ( prevState ) => ! prevState ) ;
203200 } }
201+ // Add buffer 2 to avoid popover move to top center of anchor
202+ { ...( isPlacedInLeftNav ? { anchorPosition : 'rightDown' , buffer : 2 } : { } ) }
204203 >
205204 < EuiContextMenuPanel > { contextMenuPanel } </ EuiContextMenuPanel >
206205 </ EuiPopover >
0 commit comments