-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[docs][Backdrop] Improvements to docs #34244
Conversation
this is the js file that I added from the MUI doc example and here are two things that we solve: 1. changing color: '#fff'(line41) to background: "#333333e6" since setting color won't do anything in the backdrop but setting background color will actually change backdrop color. 2. handleToggle(line33) doesn't need to be a toggle since it's not togglable! when the backdrop opens there is no access by clicking it so it basically can only open the dialog in this case it's better to write it this way: ``` handleOpen = () => { setOpen(true) }; ``` at the same time even if we don't change the function it still has some problems you shouldn't change the state value directly so it has the be like this : ``` const handleToggle = () => { setOpen(value => !value); }; ``` Signed-off-by: alireza <94165013+alirezahekmati@users.noreply.github.com>
please read the comment first the changes in the repo are here only to help you to see the example from the doc since it's not shown here. |
Netlify deploy previewBundle size report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the demo file (.tsx, .js) instead of the markdown.
@siriwatknp I moved the new demo code to where it belongs, and took the opportunity to do some light copy editing on the page as well. I think it's ready to go now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samuelsycamore I pushed the following two commits:
- You removed the code snippet from markdown but the demo code was not updated as proposed by the author - faf1235
- Changed text to
CircularProgress
component - 5b16f07
Looks good now!
@@ -16,7 +16,7 @@ In its simplest form, the Backdrop component will add a dimmed layer over your a | |||
|
|||
## Example | |||
|
|||
The demo below shows a basic Backdrop with a Circular Progress component in the foreground to indicate a loading state. | |||
The demo below shows a basic Backdrop with a `CircularProgress` component in the foreground to indicate a loading state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was correct before—see Style conventions for components from the Handbook Style Guide. The backtick style is an old convention being phased out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I was not aware of it. Reverting it in #36837.
this is the js file that I added from the MUI doc example and here are two things that we solve:
changing color: '#fff'(line41) to background: "#333333e6" since setting color won't do anything in the backdrop but setting background color will actually change backdrop color.
handleToggle(line33) doesn't need to be a toggle since it's not togglable! when the backdrop opens there is no access by clicking it so it basically can only open the dialog in this case it's better to write it this way:
at the same time even if we don't change the function it still has some problems you shouldn't change the state value directly so it has the be like this :
Signed-off-by: alireza 94165013+alirezahekmati@users.noreply.github.com