From 33d3818e1fe7b5c3703363c716a0b1040fb91ae6 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 11 Aug 2017 09:51:40 -0400 Subject: Add character limit to channel header edit modal (#7179) --- webapp/components/textbox.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'webapp/components/textbox.jsx') 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 = ( ); this.props.handlePostError(errorMessage); -- cgit v1.2.3-1-g7c22