Skip to content

Commit

Permalink
Rename hideChart to isLoadingWithoutChart
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova committed Jul 18, 2023
1 parent ce1803e commit 2741ba5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const AlertSummaryWidget = ({
timeRange,
});

if (isLoading) return <AlertSummaryWidgetLoader fullSize={fullSize} hideChart={hideChart} />;
if (isLoading)
return <AlertSummaryWidgetLoader fullSize={fullSize} isLoadingWithoutChart={hideChart} />;

if (error) return <AlertSummaryWidgetError />;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ import React from 'react';
import { EuiLoadingChart, EuiLoadingSpinner } from '@elastic/eui';
import { AlertSummaryWidgetProps } from '..';

type Props = Pick<AlertSummaryWidgetProps, 'fullSize' | 'hideChart'>;
type Props = { isLoadingWithoutChart: boolean | undefined } & Pick<
AlertSummaryWidgetProps,
'fullSize'
>;

export const AlertSummaryWidgetLoader = ({ fullSize, hideChart }: Props) => {
export const AlertSummaryWidgetLoader = ({ fullSize, isLoadingWithoutChart }: Props) => {
return (
<div
style={{
minHeight: hideChart ? 44 : fullSize ? 238 : 224,
minHeight: isLoadingWithoutChart ? 44 : fullSize ? 238 : 224,
display: 'flex',
alignItems: 'center',
justifyContent: hideChart ? 'flex-start' : 'center',
justifyContent: isLoadingWithoutChart ? 'flex-start' : 'center',
}}
>
{hideChart ? (
{isLoadingWithoutChart ? (
<EuiLoadingSpinner size="m" />
) : (
<EuiLoadingChart size="l" data-test-subj="alertSummaryWidgetLoading" />
Expand Down

0 comments on commit 2741ba5

Please sign in to comment.