forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdivider.jsx
More file actions
50 lines (44 loc) · 1.1 KB
/
Copy pathdivider.jsx
File metadata and controls
50 lines (44 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import ConfigProvider from '../config-provider';
/**
* Card.Divider
* @order 4
*/
class CardDivider extends Component {
static propTypes = {
prefix: PropTypes.string,
/**
* 设置标签类型
*/
component: PropTypes.elementType,
/**
* 分割线是否向内缩进
*/
inset: PropTypes.bool,
className: PropTypes.string,
};
static defaultProps = {
prefix: 'next-',
component: 'hr',
};
render() {
const {
prefix,
component: Component,
inset,
className,
...others
} = this.props;
const dividerClassName = classNames(
`${prefix}card-divider`,
{
[`${prefix}card-divider--inset`]: inset,
},
className
);
return <Component {...others} className={dividerClassName} />;
}
}
export default ConfigProvider.config(CardDivider);