1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
|
3 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import React, { Component } from 'react';
|
7 | import PropTypes from 'prop-types';
|
8 | import Text from './text';
|
9 | import ConfigProvider from '../config-provider';
|
10 |
|
11 | export default (function (Tag) {
|
12 | var _class, _temp;
|
13 |
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 | var Title = (_temp = _class = function (_Component) {
|
20 | _inherits(Title, _Component);
|
21 |
|
22 | function Title() {
|
23 | _classCallCheck(this, Title);
|
24 |
|
25 | return _possibleConstructorReturn(this, _Component.apply(this, arguments));
|
26 | }
|
27 |
|
28 | Title.prototype.render = function render() {
|
29 | var _props = this.props,
|
30 | prefix = _props.prefix,
|
31 | className = _props.className,
|
32 | others = _objectWithoutProperties(_props, ['prefix', 'className']);
|
33 |
|
34 | return React.createElement(Text, _extends({}, others, {
|
35 | component: Tag,
|
36 | className: (className || '') + ' ' + prefix + 'typography-title'
|
37 | }));
|
38 | };
|
39 |
|
40 | return Title;
|
41 | }(Component), _class.propTypes = {
|
42 | prefix: PropTypes.string
|
43 | }, _class.defaultProps = {
|
44 | prefix: 'next-'
|
45 | }, _temp);
|
46 | Title.displayName = 'Title';
|
47 |
|
48 |
|
49 | Title.displayName = Tag.toUpperCase();
|
50 | return ConfigProvider.config(Title);
|
51 | }); |
\ | No newline at end of file |