UNPKG

yqcloud-ui

Version:

An enterprise-class UI design language and React-based implementation

45 lines (36 loc) 1.29 kB
import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; import _createClass from 'babel-runtime/helpers/createClass'; import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn'; import _inherits from 'babel-runtime/helpers/inherits'; import * as React from 'react'; import RippleChild from './RippleChild'; var Ripple = function (_React$Component) { _inherits(Ripple, _React$Component); function Ripple() { _classCallCheck(this, Ripple); var _this = _possibleConstructorReturn(this, (Ripple.__proto__ || Object.getPrototypeOf(Ripple)).apply(this, arguments)); _this.rippleChild = function (child) { return React.createElement( RippleChild, { prefixCls: _this.props.prefixCls }, child ); }; return _this; } _createClass(Ripple, [{ key: 'render', value: function render() { var children = this.props.children; if (!children) { return null; } return React.Children.map(children, this.rippleChild); } }]); return Ripple; }(React.Component); export default Ripple; Ripple.defaultProps = { prefixCls: 'ant-ripple' };