diff options
Diffstat (limited to 'app/assets/javascripts/components/components/account.jsx')
-rw-r--r-- | app/assets/javascripts/components/components/account.jsx | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/app/assets/javascripts/components/components/account.jsx b/app/assets/javascripts/components/components/account.jsx index 6fda5915e..18197380e 100644 --- a/app/assets/javascripts/components/components/account.jsx +++ b/app/assets/javascripts/components/components/account.jsx @@ -1,5 +1,5 @@ -import PureRenderMixin from 'react-addons-pure-render-mixin'; import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; import Avatar from './avatar'; import DisplayName from './display_name'; import Permalink from './permalink'; @@ -19,30 +19,26 @@ const buttonsStyle = { height: '18px' }; -const Account = React.createClass({ +class Account extends React.PureComponent { - propTypes: { - account: ImmutablePropTypes.map.isRequired, - me: React.PropTypes.number.isRequired, - onFollow: React.PropTypes.func.isRequired, - onBlock: React.PropTypes.func.isRequired, - onMute: React.PropTypes.func.isRequired, - intl: React.PropTypes.object.isRequired - }, - - mixins: [PureRenderMixin], + constructor (props, context) { + super(props, context); + this.handleFollow = this.handleFollow.bind(this); + this.handleBlock = this.handleBlock.bind(this); + this.handleMute = this.handleMute.bind(this); + } handleFollow () { this.props.onFollow(this.props.account); - }, + } handleBlock () { this.props.onBlock(this.props.account); - }, + } handleMute () { this.props.onMute(this.props.account); - }, + } render () { const { account, me, intl } = this.props; @@ -86,6 +82,15 @@ const Account = React.createClass({ ); } -}); +} + +Account.propTypes = { + account: ImmutablePropTypes.map.isRequired, + me: PropTypes.number.isRequired, + onFollow: PropTypes.func.isRequired, + onBlock: PropTypes.func.isRequired, + onMute: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired +} export default injectIntl(Account); |