Switching to @Radium decorator
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import React, { Component } from 'react'
|
||||
import Radium from 'radium'
|
||||
import PropTypes from 'prop-types'
|
||||
import { reactAutoBind } from 'auto-bind2'
|
||||
|
||||
@Radium
|
||||
export class Dimmer extends Component {
|
||||
static propTypes = {
|
||||
active: PropTypes.bool.isRequired,
|
||||
@@ -27,22 +27,15 @@ export class Dimmer extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
reactAutoBind(this)
|
||||
}
|
||||
|
||||
preventPropagation(e) {
|
||||
handleClick(e) {
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.props.active ? (
|
||||
<div style={Dimmer.style.div} onClick={this.preventPropagation}>
|
||||
<div style={Dimmer.style.div} onClick={this.handleClick}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
) : null
|
||||
}
|
||||
}
|
||||
|
||||
export default Radium(Dimmer)
|
||||
|
||||
Reference in New Issue
Block a user