Skip to content

Commit

Permalink
revert Ripple changes
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 27, 2019
1 parent 7b9e4e3 commit b572e0c
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions packages/material-ui/src/ButtonBase/Ripple.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/styles';
import { Transition } from 'react-transition-group';

const useStyles = makeStyles({
root: props => ({
width: props.rippleSize,
height: props.rippleSize,
top: -(props.rippleSize / 2) + props.rippleY,
left: -(props.rippleSize / 2) + props.rippleX,
}),
});

/**
* @ignore - internal component.
*/
function Ripple(props) {
const { classes, className, pulsate, rippleX, rippleY, rippleSize, ...other } = props;
const rippleClasses = useStyles({ rippleX, rippleY, rippleSize });
const [visible, setVisible] = React.useState(false);
const [leaving, setLeaving] = React.useState(false);

Expand All @@ -37,17 +26,23 @@ function Ripple(props) {
[classes.ripplePulsate]: pulsate,
},
className,
rippleClasses.root,
);

const rippleStyles = {
width: rippleSize,
height: rippleSize,
top: -(rippleSize / 2) + rippleY,
left: -(rippleSize / 2) + rippleX,
};

const childClassName = clsx(classes.child, {
[classes.childLeaving]: leaving,
[classes.childPulsate]: pulsate,
});

return (
<Transition onEnter={handleEnter} onExit={handleExit} {...other}>
<span className={rippleClassName}>
<span className={rippleClassName} style={rippleStyles}>
<span className={childClassName} />
</span>
</Transition>
Expand Down

0 comments on commit b572e0c

Please sign in to comment.