File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
22import PropTypes from 'prop-types' ;
33import classNames from 'classnames' ;
4+ import { mapToCssModules } from './utils' ;
45
56const propTypes = {
67 tag : PropTypes . oneOfType ( [ PropTypes . func , PropTypes . string ] ) ,
@@ -9,6 +10,7 @@ const propTypes = {
910 color : PropTypes . string ,
1011 action : PropTypes . bool ,
1112 className : PropTypes . any ,
13+ cssModule : PropTypes . object ,
1214} ;
1315
1416const defaultProps = {
@@ -22,21 +24,22 @@ const handleDisabledOnClick = (e) => {
2224const ListGroupItem = ( props ) => {
2325 const {
2426 className,
27+ cssModule,
2528 tag : Tag ,
2629 active,
2730 disabled,
2831 action,
2932 color,
3033 ...attributes
3134 } = props ;
32- const classes = classNames (
35+ const classes = mapToCssModules ( classNames (
3336 className ,
3437 active ? 'active' : false ,
3538 disabled ? 'disabled' : false ,
3639 action ? 'list-group-item-action' : false ,
3740 color ? `list-group-item-${ color } ` : false ,
3841 'list-group-item'
39- ) ;
42+ ) , cssModule ) ;
4043
4144 // Prevent click event when disabled.
4245 if ( disabled ) {
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import PropTypes from 'prop-types' ;
33import classNames from 'classnames' ;
4+ import { mapToCssModules } from './utils' ;
45
56const propTypes = {
67 tag : PropTypes . oneOfType ( [ PropTypes . func , PropTypes . string ] ) ,
7- className : PropTypes . any
8+ className : PropTypes . any ,
9+ cssModule : PropTypes . object ,
810} ;
911
1012const defaultProps = {
@@ -14,13 +16,14 @@ const defaultProps = {
1416const ListGroupItemHeading = ( props ) => {
1517 const {
1618 className,
19+ cssModule,
1720 tag : Tag ,
1821 ...attributes
1922 } = props ;
20- const classes = classNames (
23+ const classes = mapToCssModules ( classNames (
2124 className ,
2225 'list-group-item-heading'
23- ) ;
26+ ) , cssModule ) ;
2427
2528 return (
2629 < Tag { ...attributes } className = { classes } />
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import PropTypes from 'prop-types' ;
33import classNames from 'classnames' ;
4+ import { mapToCssModules } from './utils' ;
45
56const propTypes = {
67 tag : PropTypes . oneOfType ( [ PropTypes . func , PropTypes . string ] ) ,
7- className : PropTypes . any
8+ className : PropTypes . any ,
9+ cssModule : PropTypes . object ,
810} ;
911
1012const defaultProps = {
@@ -14,13 +16,14 @@ const defaultProps = {
1416const ListGroupItemText = ( props ) => {
1517 const {
1618 className,
19+ cssModule,
1720 tag : Tag ,
1821 ...attributes
1922 } = props ;
20- const classes = classNames (
23+ const classes = mapToCssModules ( classNames (
2124 className ,
2225 'list-group-item-text'
23- ) ;
26+ ) , cssModule ) ;
2427
2528 return (
2629 < Tag { ...attributes } className = { classes } />
You can’t perform that action at this time.
0 commit comments