forked from coreui/coreui-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCButtonClose.js
50 lines (40 loc) · 885 Bytes
/
CButtonClose.js
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 from 'react'
import PropTypes from 'prop-types'
import classNames from 'classnames'
//component - CoreUI / CButtonClose
const CButtonClose = props => {
const {
children,
className,
//
buttonClass,
innerRef,
...attributes
} = props
//render
const classes = classNames(
buttonClass,
className
)
return (
<button
className={classes}
aria-label="Close"
{...attributes}
ref={innerRef}
>
{ children || String.fromCharCode(215) }
</button>
)
}
CButtonClose.propTypes = {
children: PropTypes.node,
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]),
//
buttonClass: PropTypes.string,
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]),
}
CButtonClose.defaultProps = {
buttonClass: 'close'
}
export default CButtonClose