Skip to content

Commit

Permalink
[8.x] improve loading UI in Discover mobile (elastic#197939) (elastic…
Browse files Browse the repository at this point in the history
…#198457)

# Backport

This will backport the following commits from `main` to `8.x`:
- [improve loading UI in Discover mobile
(elastic#197939)](elastic#197939)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"youhonglian","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-30T23:41:06Z","message":"improve
loading UI in Discover mobile (elastic#197939)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/151503\r\n\r\nIn this PR, use
the EuiEmptyPrompt component to update the loading
UI\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee
<[email protected]>","sha":"7d0f15b160fd2c7bc1d80e62f3499827970fccc1","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","💝community","v9.0.0","Team:DataDiscovery","backport:prev-minor"],"title":"improve
loading UI in Discover
mobile","number":197939,"url":"https://github.com/elastic/kibana/pull/197939","mergeCommit":{"message":"improve
loading UI in Discover mobile (elastic#197939)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/151503\r\n\r\nIn this PR, use
the EuiEmptyPrompt component to update the loading
UI\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee
<[email protected]>","sha":"7d0f15b160fd2c7bc1d80e62f3499827970fccc1"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197939","number":197939,"mergeCommit":{"message":"improve
loading UI in Discover mobile (elastic#197939)\n\n## Summary\r\n\r\nCloses
https://github.com/elastic/kibana/issues/151503\r\n\r\nIn this PR, use
the EuiEmptyPrompt component to update the loading
UI\r\n\r\n---------\r\n\r\nCo-authored-by: Davis McPhee
<[email protected]>","sha":"7d0f15b160fd2c7bc1d80e62f3499827970fccc1"}}]}]
BACKPORT-->

Co-authored-by: youhonglian <[email protected]>
  • Loading branch information
kibanamachine and youhonglian authored Oct 31, 2024
1 parent 12eaa43 commit c75d892
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiLoadingElastic } from '@elastic/eui';
import { EuiEmptyPrompt, EuiLoadingSpinner, EuiLoadingElastic } from '@elastic/eui';
import React from 'react';

interface Props {
Expand All @@ -16,10 +16,8 @@ interface Props {

export const LoadingIndicator = ({ type = 'spinner' }: Props) => {
return (
<EuiFlexGroup justifyContent="spaceAround" alignItems="center" gutterSize="none">
<EuiFlexItem grow={false}>
{type === 'spinner' ? <EuiLoadingSpinner size="l" /> : <EuiLoadingElastic size="xxl" />}
</EuiFlexItem>
</EuiFlexGroup>
<EuiEmptyPrompt
icon={type === 'spinner' ? <EuiLoadingSpinner size="l" /> : <EuiLoadingElastic size="xxl" />}
/>
);
};

0 comments on commit c75d892

Please sign in to comment.