diff options
author | bonespiked <dngreene@gmail.com> | 2017-04-01 17:00:30 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-04-01 17:00:30 -0400 |
commit | c3d095b465ed87c086409992ef78b62a06c09909 (patch) | |
tree | fc762abfae4b80451fbefb58b5abbd68481f6d29 /webapp/components/emoji_picker/emoji_picker.jsx | |
parent | 95da05a8c97332d8eff90c7587ed17a41966c5f0 (diff) | |
download | chat-c3d095b465ed87c086409992ef78b62a06c09909.tar.gz chat-c3d095b465ed87c086409992ef78b62a06c09909.tar.bz2 chat-c3d095b465ed87c086409992ef78b62a06c09909.zip |
Add reaction picker (#5904)
Diffstat (limited to 'webapp/components/emoji_picker/emoji_picker.jsx')
-rw-r--r-- | webapp/components/emoji_picker/emoji_picker.jsx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/webapp/components/emoji_picker/emoji_picker.jsx b/webapp/components/emoji_picker/emoji_picker.jsx index e12974054..0f45b7297 100644 --- a/webapp/components/emoji_picker/emoji_picker.jsx +++ b/webapp/components/emoji_picker/emoji_picker.jsx @@ -34,7 +34,7 @@ class EmojiPicker extends React.Component { static propTypes = { customEmojis: React.PropTypes.object, onEmojiClick: React.PropTypes.func.isRequired, - topOrBottom: React.PropTypes.string.isRequired, + pickerLocation: React.PropTypes.string.isRequired, emojiOffset: React.PropTypes.number, outsideClick: React.PropTypes.func } @@ -68,7 +68,9 @@ class EmojiPicker extends React.Component { onOutsideEvent = (event) => { // Handle the event. - this.props.outsideClick(event); + if (this.props.outsideClick) { + this.props.outsideClick(event); + } } handleCategoryClick(category) { @@ -287,7 +289,17 @@ class EmojiPicker extends React.Component { items.push(this.renderCategory(category, this.state.filter)); } } - const cssclass = this.props.topOrBottom === 'top' ? 'emoji-picker' : 'emoji-picker-bottom'; + let cssclass = 'emoji-picker '; + if (this.props.pickerLocation === 'top') { + cssclass += 'emoji-picker-top'; + } else if (this.props.pickerLocation === 'bottom') { + cssclass += 'emoji-picker-bottom'; + } else if (this.props.pickerLocation === 'react') { + cssclass = 'emoji-picker-react'; + } else if (this.props.pickerLocation === 'react-rhs-comment') { + cssclass = 'emoji-picker-react-rhs-comment'; + } + const pickerStyle = this.props.emojiOffset ? {top: this.props.emojiOffset} : {}; return ( <div |