Skip to content

Commit

Permalink
Remove defaultProps from LoadingIndicator
Browse files Browse the repository at this point in the history
Partially Resolves jaegertracing#2596
- Updated the LoadingIndicator component to remove defaultProps so as to avoid the deprecation warnings.
- Updated the snapshots so as to match the new LoadingIndicator.

Signed-off-by: Abhishek <[email protected]>
  • Loading branch information
its-me-abhishek committed Jan 20, 2025
1 parent 657cd00 commit 7390573
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
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
17 changes: 8 additions & 9 deletions packages/jaeger-ui/src/components/common/LoadingIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ type LoadingIndicatorProps = {
style?: React.CSSProperties;
};

export default function LoadingIndicator(props: LoadingIndicatorProps) {
const { centered, vcentered, className, small, ...rest } = props;
export default function LoadingIndicator({
centered = false,
vcentered,
className,
small = false,
...rest
}: LoadingIndicatorProps) {
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,
};

0 comments on commit 7390573

Please sign in to comment.