Fixes Spaces loading spinner alignment (#148424)

Resolves #147993

Adds vertical alignment to the EuiLoadingSpinner in the Spaces
navigation popover button.

Previous render:
<img width="178" alt="Screen Shot 2023-01-04 at 6 23 27 PM"
src="https://user-images.githubusercontent.com/103939324/210668671-6b0224c1-a43f-4b72-818c-0cb813b7c6ac.png">

New render:
<img width="174" alt="Screen Shot 2023-01-04 at 6 25 04 PM"
src="https://user-images.githubusercontent.com/103939324/210668809-a620b4f6-cd1b-4db5-b2d7-3792a91bb319.png">

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jeramy Soucy 2023-01-05 13:29:08 -05:00 committed by GitHub
parent 81bb8ac3c0
commit 2a7ebcfc65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -15,6 +15,7 @@ exports[`NavControlPopover renders without crashing 1`] = `
title="loading spaces navigation"
>
<EuiLoadingSpinner
className="eui-alignMiddle"
size="m"
/>
<p

View file

@ -135,15 +135,19 @@ export class NavControlPopover extends Component<Props, State> {
});
}
private getAlignedLoadingSpinner() {
return <EuiLoadingSpinner size="m" className="eui-alignMiddle" />;
}
private getActiveSpaceButton = () => {
const { activeSpace } = this.state;
if (!activeSpace) {
return this.getButton(<EuiLoadingSpinner size="m" />, 'loading spaces navigation');
return this.getButton(this.getAlignedLoadingSpinner(), 'loading spaces navigation');
}
return this.getButton(
<Suspense fallback={<EuiLoadingSpinner size="m" />}>
<Suspense fallback={this.getAlignedLoadingSpinner()}>
<LazySpaceAvatar space={activeSpace} size={'s'} />
</Suspense>,
(activeSpace as Space).name