Adds character count to reply box 😳 (#1634)

* Added characters remaining to reply box

* Changed warning text for character length

* Decreased font size of message
This commit is contained in:
Suhavi Sandhu 2021-01-13 08:46:45 -05:00 committed by GitHub
parent fd181f18a1
commit dad737021f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 6 deletions

View file

@ -1,6 +1,11 @@
<template>
<div class="reply-box" :class="replyBoxClass">
<reply-top-panel :mode="replyType" :set-reply-mode="setReplyMode" />
<reply-top-panel
:mode="replyType"
:set-reply-mode="setReplyMode"
:is-message-length-reaching-threshold="isMessageLengthReachingThreshold"
:characters-remaining="charactersRemaining"
/>
<div class="reply-box__top">
<canned-response
v-if="showCannedResponsesList"
@ -111,10 +116,10 @@ export default {
: this.$t('CONVERSATION.FOOTER.MSG_INPUT');
},
isMessageLengthReachingThreshold() {
return this.message.length > this.maxLength - 40;
return this.message.length > this.maxLength - 50;
},
characterCountIndicator() {
return `${this.message.length} / ${this.maxLength}`;
charactersRemaining() {
return this.maxLength - this.message.length;
},
isReplyButtonDisabled() {
const isMessageEmpty = !this.message.trim().replace(/\n/g, '').length;