Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ exports[`<SidePanel> render renders detailLink 1`] = `
className="Ddg--DetailsPanel--LoadingWrapper"
>
<LoadingIndicator
centered={false}
className="Ddg--DetailsPanel--LoadingIndicator"
small={false}
/>
</div>
<VerticalResizer
Expand Down Expand Up @@ -268,9 +266,7 @@ exports[`<SidePanel> render renders while loading 1`] = `
className="Ddg--DetailsPanel--LoadingWrapper"
>
<LoadingIndicator
centered={false}
className="Ddg--DetailsPanel--LoadingIndicator"
small={false}
/>
</div>
<VerticalResizer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ exports[`<ServiceGraph> Loading indicator is displayed 1`] = `
>
<LoadingIndicator
centered={true}
small={false}
/>
</div>
</div>
Expand Down Expand Up @@ -735,7 +734,6 @@ exports[`<ServiceGraph> Loading indicator is displayed when xDomain is empty 1`]
>
<LoadingIndicator
centered={true}
small={false}
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ exports[`<OperationTableDetails> "Couldn’t fetch data" displayed 1`] = `
exports[`<OperationTableDetails> Loading indicator is displayed 1`] = `
<LoadingIndicator
centered={true}
small={false}
/>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ exports[`QualityMetrics UnconnectedQualityMetrics render renders when loading 1`
/>
<LoadingIndicator
centered={true}
small={false}
/>
</div>
`;
Expand Down
25 changes: 12 additions & 13 deletions packages/jaeger-ui/src/components/common/LoadingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,27 @@ import { LuLoader2 } from 'react-icons/lu';

import './LoadingIndicator.css';

type LoadingIndicatorProps = {
export default function LoadingIndicator({
centered = false,
vcentered,
className = '',
small = false,
style,
...rest
}: {
centered?: boolean;
vcentered?: boolean;
className?: string;
small?: boolean;
style?: React.CSSProperties;
};

export default function LoadingIndicator(props: LoadingIndicatorProps) {
const { centered, vcentered, className, small, ...rest } = props;
}) {
const cls = `
LoadingIndicator
${centered ? 'is-centered' : ''}
${vcentered ? 'is-vcentered' : ''}
${small ? 'is-small' : ''}
${className || ''}
${className}
`;
return <LuLoader2 className={cls} {...rest} />;
}

LoadingIndicator.defaultProps = {
centered: false,
className: undefined,
small: false,
};
return <LuLoader2 className={cls} {...rest} style={style} />;
}
Loading