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

[Grow] Condense the demo #13665

Merged
merged 2 commits into from
Nov 21, 2018
Merged
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
23 changes: 11 additions & 12 deletions docs/src/pages/utils/transitions/SimpleGrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,26 @@ class SimpleGrow extends React.Component {
const { classes } = this.props;
const { checked } = this.state;

const polygon = (
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps not the best choice of variable name...

Copy link
Member

Choose a reason for hiding this comment

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

child?

<Paper elevation={4} className={classes.paper}>
<svg className={classes.svg}>
<polygon points="0,100 50,00, 100,100" className={classes.polygon} />
</svg>
</Paper>
);

return (
<div className={classes.root}>
<Switch checked={checked} onChange={this.handleChange} aria-label="Collapse" />
<div className={classes.container}>
<Grow in={checked}>
<Paper elevation={4} className={classes.paper}>
<svg className={classes.svg}>
<polygon points="0,100 50,00, 100,100" className={classes.polygon} />
</svg>
</Paper>
</Grow>
<Grow in={checked}>{polygon}</Grow>
{/* Conditionally applies the timeout property to change the entry speed. */}
<Grow
in={checked}
style={{ transformOrigin: '0 0 0' }}
{...(checked ? { timeout: 1000 } : {})}
>
<Paper elevation={4} className={classes.paper}>
<svg className={classes.svg}>
<polygon points="0,100 50,00, 100,100" className={classes.polygon} />
</svg>
</Paper>
{polygon}
</Grow>
</div>
</div>
Expand Down