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

[docs] Polish Slider demos #38759

Merged
merged 2 commits into from
Sep 3, 2023

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Sep 2, 2023

@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation component: transitions This is the name of the generic UI component, not the React module! labels Sep 2, 2023
@@ -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}}
Copy link
Member Author

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 }}>
Copy link
Member Author

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}>
Copy link
Member Author

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.

Comment on lines -27 to +26
const containerRef = React.useRef(null);
const containerRef = React.useRef<HTMLElement>(null);
Copy link
Member Author

Choose a reason for hiding this comment

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

The type was wrong.

Comment on lines 0 to 7
<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>
Copy link
Member Author

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>
Copy link
Member Author

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.

@mui-bot
Copy link

mui-bot commented Sep 2, 2023

Netlify deploy preview

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against 351063f

@oliviertassinari oliviertassinari merged commit 31e2f14 into mui:master Sep 3, 2023
@oliviertassinari oliviertassinari deleted the polish-slide-demo branch September 3, 2023 00:08
@danilo-leal danilo-leal added the package: material-ui Specific to @mui/material label Sep 5, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
mnajdova pushed a commit to mnajdova/material-ui that referenced this pull request Sep 8, 2023
xcode-it pushed a commit to xcode-it/material-ui that referenced this pull request Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: transitions This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation package: material-ui Specific to @mui/material
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants