diff options
author | 2018-07-06 01:32:43 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | 7f25b0f261b5a5fc2696054004fb24673375b91b (patch) | |
tree | 38ee591e176b4799e39eff7a16f1950e017e7bb4 /vnext/src/components/MessageInput.js | |
parent | 88732ba8c06c23a93f7248b6eabc182f38be3d33 (diff) |
Proptypes & eslint
Diffstat (limited to 'vnext/src/components/MessageInput.js')
-rw-r--r-- | vnext/src/components/MessageInput.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vnext/src/components/MessageInput.js b/vnext/src/components/MessageInput.js index 5d603a4b..1260b6fb 100644 --- a/vnext/src/components/MessageInput.js +++ b/vnext/src/components/MessageInput.js @@ -8,7 +8,7 @@ import Button from './Button'; export default class MessageInput extends React.Component { constructor(props) { - super(props) + super(props); this.textarea = React.createRef(); this.fileinput = React.createRef(); this.state = { @@ -23,7 +23,7 @@ export default class MessageInput extends React.Component { handleCtrlEnter = (event) => { if (event.ctrlKey && (event.charCode == 10 || event.charCode == 13)) { - this.onSubmit({}) + this.onSubmit({}); } } @@ -65,9 +65,9 @@ export default class MessageInput extends React.Component { if (this.state.attach) { this.setState({ attach: '' - }) + }); } else { - input.click() + input.click(); } } render() { @@ -76,7 +76,7 @@ export default class MessageInput extends React.Component { <div style={commentStyle}> <textarea name="body" onChange={this.textChanged} onKeyPress={this.handleCtrlEnter} ref={this.textarea} style={textInputStyle} value={this.state.body} - rows={this.props.rows || "1"} placeholder={this.props.children} /> + rows={this.props.rows || '1'} placeholder={this.props.children} /> <div style={inputBarStyle}> <div style={this.state.attach ? activeStyle : inactiveStyle} onClick={this.openfile}> @@ -115,7 +115,7 @@ const inputBarStyle = { alignItems: 'center', justifyContent: 'space-between', padding: '3px' -} +}; const textInputStyle = { overflow: 'hidden', @@ -124,13 +124,13 @@ const textInputStyle = { boxSizing: 'border-box', border: 0, outline: 'none', - padding: '4px', - resize: 'none' -} + padding: '4px' +}; MessageInput.propTypes = { + children: PropTypes.node, data: MessageType.isRequired, onSend: PropTypes.func.isRequired, rows: PropTypes.string, text: PropTypes.string -};
\ No newline at end of file +}; |