Switching to @Radium decorator

This commit is contained in:
John Lyon-Smith
2018-03-22 15:27:12 -07:00
parent 06ae76047e
commit 1b35ac8b22
32 changed files with 115 additions and 122 deletions

View File

@@ -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)