diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-08-11 09:51:40 -0400 |
---|---|---|
committer | Saturnino Abril <saturnino.abril@gmail.com> | 2017-08-11 21:51:40 +0800 |
commit | 33d3818e1fe7b5c3703363c716a0b1040fb91ae6 (patch) | |
tree | c5d45c8bce140522b306dfb4d81ae0ce978f275c /webapp/components/textbox.jsx | |
parent | 48741434aa955d93e15e44f207294f0d90c2e0da (diff) | |
download | chat-33d3818e1fe7b5c3703363c716a0b1040fb91ae6.tar.gz chat-33d3818e1fe7b5c3703363c716a0b1040fb91ae6.tar.bz2 chat-33d3818e1fe7b5c3703363c716a0b1040fb91ae6.zip |
Add character limit to channel header edit modal (#7179)
Diffstat (limited to 'webapp/components/textbox.jsx')
-rw-r--r-- | webapp/components/textbox.jsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 3e62d98bc..cf1d054cf 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -38,13 +38,15 @@ export default class Textbox extends React.Component { suggestionListStyle: PropTypes.string, emojiEnabled: PropTypes.bool, isRHS: PropTypes.bool, - popoverMentionKeyClick: React.PropTypes.bool + popoverMentionKeyClick: React.PropTypes.bool, + characterLimit: React.PropTypes.number }; static defaultProps = { supportsCommands: true, isRHS: false, - popoverMentionKeyClick: false + popoverMentionKeyClick: false, + characterLimit: Constants.CHARACTER_LIMIT }; constructor(props) { @@ -93,14 +95,14 @@ export default class Textbox extends React.Component { checkMessageLength = (message) => { if (this.props.handlePostError) { - if (message.length > Constants.CHARACTER_LIMIT) { + if (message.length > this.props.characterLimit) { const errorMessage = ( <FormattedMessage id='create_post.error_message' defaultMessage='Your message is too long. Character count: {length}/{limit}' values={{ length: message.length, - limit: Constants.CHARACTER_LIMIT + limit: this.props.characterLimit }} />); this.props.handlePostError(errorMessage); |