diff options
Diffstat (limited to 'app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js')
-rw-r--r-- | app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js index c95b4a279..9ad0ae296 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js @@ -40,28 +40,26 @@ let EmojiPicker; // load asynchronously class EmojiPickerDropdown extends React.PureComponent { - constructor (props, context) { - super(props, context); - this.setRef = this.setRef.bind(this); - this.handleChange = this.handleChange.bind(this); - this.onHideDropdown = this.onHideDropdown.bind(this); - this.onShowDropdown = this.onShowDropdown.bind(this); - this.state = { - active: false, - loading: false - }; - } + static propTypes = { + intl: PropTypes.object.isRequired, + onPickEmoji: PropTypes.func.isRequired + }; + + state = { + active: false, + loading: false + }; - setRef (c) { + setRef = (c) => { this.dropdown = c; } - handleChange (data) { + handleChange = (data) => { this.dropdown.hide(); this.props.onPickEmoji(data); } - onShowDropdown () { + onShowDropdown = () => { this.setState({active: true}); if (!EmojiPicker) { this.setState({loading: true}); @@ -75,7 +73,7 @@ class EmojiPickerDropdown extends React.PureComponent { } } - onHideDropdown () { + onHideDropdown = () => { this.setState({active: false}); } @@ -138,9 +136,4 @@ class EmojiPickerDropdown extends React.PureComponent { } -EmojiPickerDropdown.propTypes = { - intl: PropTypes.object.isRequired, - onPickEmoji: PropTypes.func.isRequired -}; - export default injectIntl(EmojiPickerDropdown); |