Skip to content

Commit 118fa2a

Browse files
committedMay 14, 2020
chore: CListGroupItemHeading, CListGroupItemText - clean components
1 parent 7b7d9c6 commit 118fa2a

File tree

5 files changed

+76
-86
lines changed

5 files changed

+76
-86
lines changed
 

‎src/CListGroupHeading.js

-42
This file was deleted.

‎src/CListGroupItemHeading.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import classNames from 'classnames'
4+
import { tagPropType } from './Shared/helper.js'
5+
6+
//component - CoreUI / CListGroupItemHeading
7+
const CListGroupItemHeading = props => {
8+
9+
const {
10+
tag: Tag,
11+
className,
12+
//
13+
innerRef,
14+
...attributes
15+
} = props
16+
17+
// render
18+
const classes = classNames('list-group-item-heading', className)
19+
20+
return (
21+
<Tag className={classes} {...attributes} ref={innerRef} />
22+
)
23+
24+
}
25+
26+
CListGroupItemHeading.propTypes = {
27+
tag: tagPropType,
28+
className: PropTypes.any,
29+
//
30+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string])
31+
}
32+
33+
CListGroupItemHeading.defaultProps = {
34+
tag: 'h5'
35+
}
36+
37+
export default CListGroupItemHeading

‎src/CListGroupItemText.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
import PropTypes from 'prop-types'
3+
import classNames from 'classnames'
4+
import { tagPropType } from './Shared/helper.js'
5+
6+
//component - CoreUI / CListGroupItemText
7+
const CListGroupItemText = props => {
8+
9+
const {
10+
tag: Tag,
11+
className,
12+
//
13+
innerRef,
14+
...attributes
15+
} = props
16+
17+
//render
18+
const classes = classNames('list-group-item-text', className)
19+
20+
return (
21+
<Tag className={classes} {...attributes} ref={innerRef} />
22+
)
23+
24+
}
25+
26+
CListGroupItemText.propTypes = {
27+
tag: tagPropType,
28+
className: PropTypes.any,
29+
//
30+
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string])
31+
}
32+
33+
CListGroupItemText.defaultProps = {
34+
tag: 'p'
35+
}
36+
37+
export default CListGroupItemText

‎src/CListGroupText.js

-42
This file was deleted.

‎src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export {CInputGroupAppend} from './CInputGroupAddon';
6464
export {default as CInputGroupText} from './CInputGroupText';
6565
export {default as CListGroup} from './CListGroup';
6666
export {default as CListGroupItem} from './CListGroupItem';
67-
export {default as CListGroupItemHeading} from './CListGroupHeading';
68-
export {default as CListGroupItemText} from './CListGroupText';
67+
export {default as CListGroupItemHeading} from './CListGroupItemHeading';
68+
export {default as CListGroupItemText} from './CListGroupItemText';
6969
export {default as CModal} from './CModal';
7070
export {default as CModalBody} from './CModalBody';
7171
export {default as CModalHeader} from './CModalHeader';

0 commit comments

Comments
 (0)
Please sign in to comment.