File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 53
53
"babel-preset-react" : " ^6.5.0" ,
54
54
"babel-preset-stage-0" : " ^6.5.0" ,
55
55
"babel-tape-runner" : " ^2.0.1" ,
56
+ "classnames" : " ^2.2.5" ,
56
57
"codecov.io" : " ^0.1.6" ,
57
58
"coveralls" : " ^2.11.6" ,
58
59
"enzyme" : " ^2.3.0" ,
Original file line number Diff line number Diff line change 1
1
import React , { Component , PropTypes } from 'react'
2
2
import HoverComponent from './lib/HoverComponent'
3
3
import TriggerComponent from './lib/TriggerComponent'
4
+ import classnames from 'classnames'
4
5
5
6
export default class ReactHover extends Component {
6
7
static propTypes = {
7
8
styles : PropTypes . object . isRequired ,
8
9
componentHtml : PropTypes . object . isRequired ,
9
- options : PropTypes . object . isRequired
10
+ options : PropTypes . object . isRequired ,
11
+ className : PropTypes . string
10
12
}
11
13
12
14
constructor ( props ) {
13
15
super ( props )
14
-
15
16
this . state = {
16
17
triggerComponentStyle : this . props . styles . trigger ,
17
18
hoverComponentStyle : this . props . styles . hoverComponent
18
19
}
19
20
}
20
21
21
22
render ( ) {
22
- const { componentHtml } = this . props
23
+ const { componentHtml, className } = this . props
23
24
const { triggerComponentStyle, hoverComponentStyle } = this . state
24
25
return (
25
- < div >
26
+ < div className = { classnames ( className ) } >
26
27
< TriggerComponent
27
28
styles = { triggerComponentStyle }
28
29
componentHtml = { componentHtml }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class App extends Component {
26
26
27
27
< h3 style = { { margin : '0 auto' , textAlign : 'center' } } > Basic </ h3 >
28
28
< ReactHover
29
+ className = 'basic'
29
30
styles = { styles . basic }
30
31
componentHtml = { componentHtml . basicComponentHtml }
31
32
options = { optionsCursorFalse }
You can’t perform that action at this time.
0 commit comments