diff options
Diffstat (limited to 'app/javascript/mastodon/components/permalink.js')
-rw-r--r-- | app/javascript/mastodon/components/permalink.js | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/app/javascript/mastodon/components/permalink.js b/app/javascript/mastodon/components/permalink.js index 26444f27c..531ece33f 100644 --- a/app/javascript/mastodon/components/permalink.js +++ b/app/javascript/mastodon/components/permalink.js @@ -3,12 +3,18 @@ import PropTypes from 'prop-types'; class Permalink extends React.PureComponent { - constructor (props, context) { - super(props, context); - this.handleClick = this.handleClick.bind(this); - } - - handleClick (e) { + static contextTypes = { + router: PropTypes.object + }; + + static propTypes = { + className: PropTypes.string, + href: PropTypes.string.isRequired, + to: PropTypes.string.isRequired, + children: PropTypes.node + }; + + handleClick = (e) => { if (e.button === 0) { e.preventDefault(); this.context.router.push(this.props.to); @@ -27,15 +33,4 @@ class Permalink extends React.PureComponent { } -Permalink.contextTypes = { - router: PropTypes.object -}; - -Permalink.propTypes = { - className: PropTypes.string, - href: PropTypes.string.isRequired, - to: PropTypes.string.isRequired, - children: PropTypes.node -}; - export default Permalink; |