Skip to content

Instantly share code, notes, and snippets.

@dhilipkmr
Last active January 26, 2019 19:46
Show Gist options
  • Save dhilipkmr/17ea2b8d70f74782fe3e80f9a807c5a2 to your computer and use it in GitHub Desktop.
Save dhilipkmr/17ea2b8d70f74782fe3e80f9a807c5a2 to your computer and use it in GitHub Desktop.
render() {
const {children= null, classes = "", onClickHandler = null} = this.props;
return (
<div ref="targetElement" className={'ripple ' + classes} onClick={onClickHandler}>
{children}
<div className="rippleContainer" onMouseDown={this.showRipple} onMouseUp={this.callCleanUp(this.cleanUp, 2000)}>
{this.renderRippleSpan()}
</div>
</div>
);
}
.ripple {
position: relative;
overflow: hidden;
}
.ripple .rippleContainer {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment