Skip to content

Commit

Permalink
refactor: update LoadingIndicator component
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriel Anyaele <[email protected]>
  • Loading branch information
Ghaby-X committed Sep 28, 2024
1 parent 3c88048 commit b620846
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 16 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
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ 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 = undefined, small = false, ...rest}: LoadingIndicatorProps) {
const cls = `
LoadingIndicator
${centered ? 'is-centered' : ''}
Expand All @@ -36,9 +35,3 @@ export default function LoadingIndicator(props: LoadingIndicatorProps) {
`;
return <LuLoader2 className={cls} {...rest} />;
}

LoadingIndicator.defaultProps = {
centered: false,
className: undefined,
small: false,
};

0 comments on commit b620846

Please sign in to comment.