Skip to content
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
Copy Markdown
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
Copy Markdown
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