UNPKG

@aliretail/react-materials-components

Version:
46 lines (40 loc) 1.23 kB
import _Message from "@alifd/next/es/message"; import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose"; import * as React from 'react'; import * as PropTypes from 'prop-types'; var MessageNotice = /*#__PURE__*/function (_React$Component) { _inheritsLoose(MessageNotice, _React$Component); function MessageNotice() { return _React$Component.apply(this, arguments) || this; } var _proto = MessageNotice.prototype; // 即便 ts 声明了 AppProps,这里还是要提供 propsTypes,用于 react 报错提示 _proto.render = function render() { var _this$props = this.props, text = _this$props.text, shape = _this$props.shape, title = _this$props.title, type = _this$props.type; return /*#__PURE__*/React.createElement(_Message, { size: "medium", title: title, type: type, shape: shape, className: "aliretail-messageTitle" }, text); }; return MessageNotice; }(React.Component); MessageNotice.propTypes = { text: PropTypes.string, shape: PropTypes.string, title: PropTypes.string, type: PropTypes.string }; MessageNotice.defaultProps = { text: '', shape: '', title: '', type: '' }; export default MessageNotice;