Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update LoadingIndicator component #2460

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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,
};
Loading