|
|
|
@ -18,6 +18,7 @@ export default class ChatInput extends Component { |
|
|
|
constructor(props, context) { |
|
|
|
constructor(props, context) { |
|
|
|
super(props, context); |
|
|
|
super(props, context); |
|
|
|
this.formMessageInput = createRef(); |
|
|
|
this.formMessageInput = createRef(); |
|
|
|
|
|
|
|
this.emojiPickerButton = createRef(); |
|
|
|
|
|
|
|
|
|
|
|
this.messageCharCount = 0; |
|
|
|
this.messageCharCount = 0; |
|
|
|
this.maxMessageLength = 500; |
|
|
|
this.maxMessageLength = 500; |
|
|
|
@ -65,10 +66,7 @@ export default class ChatInput extends Component { |
|
|
|
custom: json, |
|
|
|
custom: json, |
|
|
|
initialCategory: 'custom', |
|
|
|
initialCategory: 'custom', |
|
|
|
showPreview: false, |
|
|
|
showPreview: false, |
|
|
|
position: { |
|
|
|
position: 'top' |
|
|
|
top: '50%', |
|
|
|
|
|
|
|
right: '100' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
this.emojiPicker.on('emoji', emoji => { |
|
|
|
this.emojiPicker.on('emoji', emoji => { |
|
|
|
this.handleEmojiSelected(emoji); |
|
|
|
this.handleEmojiSelected(emoji); |
|
|
|
@ -81,7 +79,7 @@ export default class ChatInput extends Component { |
|
|
|
|
|
|
|
|
|
|
|
handleEmojiButtonClick() { |
|
|
|
handleEmojiButtonClick() { |
|
|
|
if (this.emojiPicker) { |
|
|
|
if (this.emojiPicker) { |
|
|
|
this.emojiPicker.togglePicker(this.emojiPicker); |
|
|
|
this.emojiPicker.togglePicker(this.emojiPickerButton.current); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -253,20 +251,26 @@ export default class ChatInput extends Component { |
|
|
|
onPaste=${this.handlePaste} |
|
|
|
onPaste=${this.handlePaste} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
type="button" |
|
|
|
|
|
|
|
style=${emojiButtonStyle} |
|
|
|
|
|
|
|
onclick=${this.handleEmojiButtonClick} |
|
|
|
|
|
|
|
>😏</button> |
|
|
|
|
|
|
|
<div id="message-form-actions" class="flex"> |
|
|
|
<div id="message-form-actions" class="flex"> |
|
|
|
<span id="message-form-warning" class="text-red-600 text-xs">${inputWarning}</span> |
|
|
|
<span id="message-form-warning" class="text-red-600 text-xs">${inputWarning}</span> |
|
|
|
<button |
|
|
|
|
|
|
|
onclick=${this.handleSubmitChatButton} |
|
|
|
<div id="message-form-actions-buttons" class="flex"> |
|
|
|
type="button" |
|
|
|
<button |
|
|
|
id="button-submit-message" |
|
|
|
ref=${this.emojiPickerButton} |
|
|
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded" |
|
|
|
id="emoji-button" |
|
|
|
> Chat |
|
|
|
type="button" |
|
|
|
</button> |
|
|
|
style=${emojiButtonStyle} |
|
|
|
|
|
|
|
onclick=${this.handleEmojiButtonClick} |
|
|
|
|
|
|
|
>😏</button> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<button |
|
|
|
|
|
|
|
onclick=${this.handleSubmitChatButton} |
|
|
|
|
|
|
|
type="button" |
|
|
|
|
|
|
|
id="button-submit-message" |
|
|
|
|
|
|
|
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded" |
|
|
|
|
|
|
|
> Chat |
|
|
|
|
|
|
|
</button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
`);
|
|
|
|
`);
|
|
|
|
|