mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 18:56:22 +00:00
Make InfoButton component stateless
This commit is contained in:
@@ -2,29 +2,15 @@ import React, { PropTypes } from 'react'
|
||||
import CSSModules from 'browser/lib/CSSModules'
|
||||
import styles from './InfoButton.styl'
|
||||
|
||||
class InfoButton extends React.Component {
|
||||
constructor (props) {
|
||||
super(props)
|
||||
|
||||
this.handleInfoButtonClick = this.handleInfoButtonClick.bind(this)
|
||||
}
|
||||
|
||||
handleInfoButtonClick (e) {
|
||||
e.preventDefault()
|
||||
const infoPanel= document.querySelector('.infoPanel')
|
||||
infoPanel.style.display = display === 'none' ? 'inline' : 'none'
|
||||
}
|
||||
|
||||
render () {
|
||||
return (
|
||||
<button styleName='control-infoButton'
|
||||
onClick={(e) => this.handleInfoButtonClick(e)}
|
||||
>
|
||||
<i className='fa fa-info-circle infoButton' styleName='info-button' />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
}
|
||||
const InfoButton = ({
|
||||
onClick
|
||||
}) => (
|
||||
<button styleName='control-infoButton'
|
||||
onClick={(e) => onClick(e)}
|
||||
>
|
||||
<i className='fa fa-info-circle infoButton' styleName='info-button' />
|
||||
</button>
|
||||
)
|
||||
|
||||
InfoButton.propTypes = {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user