@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
4
4
import cx from 'classnames' ;
5
5
import { themr } from 'react-css-themr' ;
6
6
import { transitionEndEventName } from '../globals/helper' ;
7
- import defaultTheme from './theme.scss' ;
7
+ import defaultTheme from './theme.module. scss' ;
8
8
9
9
const getNode = findDOMNode ;
10
10
@@ -19,19 +19,21 @@ class Badge extends React.Component {
19
19
20
20
componentDidUpdate ( prevProps ) {
21
21
if ( this . props . badgeCount !== prevProps . badgeCount ) {
22
+ const { theme } = this . props ;
22
23
const countEle = getNode ( this . animRef ) ;
23
24
countEle . addEventListener ( transitionEndEventName ( ) , this . updateCount , false ) ;
24
- countEle . classList . add ( ' fadeOut' ) ;
25
+ countEle . classList . add ( theme . fadeOut ) ;
25
26
// eslint-disable-next-line react/no-did-update-set-state
26
27
}
27
28
}
28
29
29
30
updateCount = ( ) => {
31
+ const { theme } = this . props ;
30
32
const countEle = getNode ( this . animRef ) ;
31
33
this . setState ( {
32
34
count : this . props . badgeCount ,
33
35
} ) ;
34
- countEle . classList . remove ( ' fadeOut' ) ;
36
+ countEle . classList . remove ( theme . fadeOut ) ;
35
37
} ;
36
38
37
39
render ( ) {
@@ -58,7 +60,7 @@ class Badge extends React.Component {
58
60
</ span >
59
61
</ span >
60
62
</ div >
61
- < div className = " clearfix" />
63
+ < div className = { ` ${ theme . clearfix } clearfix` } />
62
64
</ React . Fragment >
63
65
) ;
64
66
}
0 commit comments