mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
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:
parent
81bb8ac3c0
commit
2a7ebcfc65
2 changed files with 7 additions and 2 deletions
|
@ -15,6 +15,7 @@ exports[`NavControlPopover renders without crashing 1`] = `
|
|||
title="loading spaces navigation"
|
||||
>
|
||||
<EuiLoadingSpinner
|
||||
className="eui-alignMiddle"
|
||||
size="m"
|
||||
/>
|
||||
<p
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue