-
-
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] Polish Slider demos #38759
[docs] Polish Slider demos #38759
Conversation
@@ -54,7 +54,7 @@ Similarly, the `unmountOnExit` prop removes the component from the DOM after it | |||
The Slide component also accepts `container` prop, which is a reference to a DOM node. | |||
If this prop is set, the Slide component will slide from the edge of that DOM node. | |||
|
|||
{{"demo": "SlideFromContainer.js"}} | |||
{{"demo": "SlideFromContainer.js", "bg": true}} |
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.
To make it easier to compare demos.
@@ -68,17 +67,13 @@ export default function TransitionGroupExample() { | |||
return ( | |||
<div> | |||
{addFruitButton} | |||
<Box sx={{ mt: 1 }}> |
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.
No need for the Box here anymore.
<Box sx={{ width: 200 }}> | ||
<Box sx={{ width: 240, padding: 2 }} ref={containerRef}> |
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.
Move the ref to be in the online preview, makes it less confusing.
const containerRef = React.useRef(null); | ||
const containerRef = React.useRef<HTMLElement>(null); |
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.
The type was wrong.
<Box sx={{ width: `calc(100px + 16px)`, position: 'relative', zIndex: 1 }}> | ||
<FormControlLabel | ||
control={<Switch checked={checked} onChange={handleChange} />} | ||
label="Show" | ||
/> | ||
<Slide direction="up" in={checked} mountOnEnter unmountOnExit> | ||
{icon} | ||
</Slide> | ||
</Box> No newline at end of file | ||
<FormControlLabel | ||
control={<Switch checked={checked} onChange={handleChange} />} | ||
label="Show" | ||
/> | ||
<Slide direction="up" in={checked} mountOnEnter unmountOnExit> | ||
{icon} | ||
</Slide> |
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.
My initial objective.
<Paper sx={{ m: 1 }} elevation={4}> | ||
<Box component="svg" sx={{ width: 100, height: 100 }}> | ||
<Paper sx={{ m: 1, width: 100, height: 100 }} elevation={4}> | ||
<svg> |
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.
Move the style closer to where they make sense, also kill one React component along the way Box -> svg.
Netlify deploy previewBundle size report |
Seeing the change to the online preview in #38646: https://github.com/mui/material-ui/pull/38646/files#diff-abc20b07c6893afa34e4fc5d939e3ab2cae95855b4585748bee4bf3822e0cd6b
triggered me to have a quick look at improving the demos in the page.
Preview: https://deploy-preview-38759--material-ui.netlify.app/material-ui/transitions/#slide