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

feat(mui): add circular progress to <Show> #5710

Closed
wants to merge 0 commits into from

Conversation

issa012
Copy link
Contributor

@issa012 issa012 commented Mar 1, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

in MUI doesn't show loading spinner

What is the new behavior?

Added loading spinner.
fixes #5668

Notes for reviewers

Hello. This is my first PR ever. I have added the along with to render a loading spinner. Should I add the possibility to pass props to these components?
Also, what color should they be?

@issa012 issa012 requested a review from a team as a code owner March 1, 2024 07:11
Copy link

changeset-bot bot commented Mar 1, 2024

⚠️ No Changeset found

Latest commit: b4ed3be

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Member

@BatuhanW BatuhanW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @issa012 thanks for the PR!

It seems we have conflicts, let's fix them and address review comments.

@@ -219,7 +221,19 @@ export const Show: React.FC<ShowProps> = ({
}
{...(headerProps ?? {})}
/>
<CardContent {...(contentProps ?? {})}>{children}</CardContent>
<CardContent {...(contentProps ?? {})}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add tests covering these changes.

packages/mui/src/components/crud/show/index.tsx Outdated Show resolved Hide resolved
@BatuhanW BatuhanW added this to the April Release milestone Mar 4, 2024
sx={{
position: "absolute",
zIndex: (theme) => theme.zIndex.drawer + 1,
bgcolor: "rgba(255, 255, 255, 0.38)",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the hardcoded color is appropriate here. I think it's best to use the current theme to decide bgColor. We can do theme.palette.background.paper (I think this is what the <Card /> use) and use the alpha method from @mui/material/styles to adjust the opacity. This way we don't have to worry about light/dark schemes I guess 🤔

Can we try to make this change @issa012? It would be great if you can update this line and test it 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it. Now it is the same color as in component in light and dark modes. I used theme.palette.action.disabledOpacity. Thanks a lot for reviews!

@issa012
Copy link
Contributor Author

issa012 commented Mar 26, 2024

Hello @aliemir . What tests should I add for this change? Similar Antd component does not have any tests regarding the loading state. Should I update the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] <Show isLoading={true}> with Material UI doesn't show loading spinner
3 participants