cleanup lint errors

This commit is contained in:
Bruno Windels 2019-08-05 15:50:16 +02:00
parent 04bb2ed322
commit 341fdcd761

View file

@ -19,7 +19,6 @@ import PropTypes from 'prop-types';
import { _t, _td } from '../../../languageHandler'; import { _t, _td } from '../../../languageHandler';
import CallHandler from '../../../CallHandler'; import CallHandler from '../../../CallHandler';
import MatrixClientPeg from '../../../MatrixClientPeg'; import MatrixClientPeg from '../../../MatrixClientPeg';
import Modal from '../../../Modal';
import sdk from '../../../index'; import sdk from '../../../index';
import dis from '../../../dispatcher'; import dis from '../../../dispatcher';
import RoomViewStore from '../../../stores/RoomViewStore'; import RoomViewStore from '../../../stores/RoomViewStore';
@ -28,7 +27,6 @@ import Stickerpicker from './Stickerpicker';
import { makeRoomPermalink } from '../../../matrix-to'; import { makeRoomPermalink } from '../../../matrix-to';
import ContentMessages from '../../../ContentMessages'; import ContentMessages from '../../../ContentMessages';
import classNames from 'classnames'; import classNames from 'classnames';
import E2EIcon from './E2EIcon'; import E2EIcon from './E2EIcon';
const formatButtonList = [ const formatButtonList = [
@ -51,7 +49,7 @@ function ComposerAvatar(props) {
ComposerAvatar.propTypes = { ComposerAvatar.propTypes = {
me: PropTypes.object.isRequired, me: PropTypes.object.isRequired,
} };
function CallButton(props) { function CallButton(props) {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
@ -63,15 +61,15 @@ function CallButton(props) {
}); });
}; };
return <AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_voicecall" return (<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_voicecall"
onClick={onVoiceCallClick} onClick={onVoiceCallClick}
title={_t('Voice call')} title={_t('Voice call')}
/> />);
} }
CallButton.propTypes = { CallButton.propTypes = {
roomId: PropTypes.string.isRequired roomId: PropTypes.string.isRequired,
} };
function VideoCallButton(props) { function VideoCallButton(props) {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
@ -107,15 +105,15 @@ function HangupButton(props) {
room_id: call.roomId, room_id: call.roomId,
}); });
}; };
return <AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_hangup" return (<AccessibleButton className="mx_MessageComposer_button mx_MessageComposer_hangup"
onClick={onHangupClick} onClick={onHangupClick}
title={_t('Hangup')} title={_t('Hangup')}
/>; />);
} }
HangupButton.propTypes = { HangupButton.propTypes = {
roomId: PropTypes.string.isRequired, roomId: PropTypes.string.isRequired,
} };
function FormattingButton(props) { function FormattingButton(props) {
const AccessibleButton = sdk.getComponent('elements.AccessibleButton'); const AccessibleButton = sdk.getComponent('elements.AccessibleButton');
@ -133,7 +131,7 @@ function FormattingButton(props) {
FormattingButton.propTypes = { FormattingButton.propTypes = {
showFormatting: PropTypes.bool.isRequired, showFormatting: PropTypes.bool.isRequired,
onClickHandler: PropTypes.func.isRequired, onClickHandler: PropTypes.func.isRequired,
} };
class UploadButton extends React.Component { class UploadButton extends React.Component {
static propTypes = { static propTypes = {
@ -376,7 +374,7 @@ export default class MessageComposer extends React.Component {
height="17" height="17"
/> />
); );
}) });
return ( return (
<div className="mx_MessageComposer_formatbar_wrapper"> <div className="mx_MessageComposer_formatbar_wrapper">
@ -401,7 +399,9 @@ export default class MessageComposer extends React.Component {
render() { render() {
const controls = [ const controls = [
this.state.me ? <ComposerAvatar key="controls_avatar" me={this.state.me} /> : null, this.state.me ? <ComposerAvatar key="controls_avatar" me={this.state.me} /> : null,
this.props.e2eStatus ? <E2EIcon key="e2eIcon" status={this.props.e2eStatus} className="mx_MessageComposer_e2eIcon" /> : null, this.props.e2eStatus ?
<E2EIcon key="e2eIcon" status={this.props.e2eStatus} className="mx_MessageComposer_e2eIcon" /> :
null,
]; ];
if (!this.state.tombstone && this.state.canSendMessages) { if (!this.state.tombstone && this.state.canSendMessages) {
@ -421,8 +421,11 @@ export default class MessageComposer extends React.Component {
placeholder={this.renderPlaceholderText()} placeholder={this.renderPlaceholderText()}
onInputStateChanged={this.onInputStateChanged} onInputStateChanged={this.onInputStateChanged}
permalinkCreator={this.props.permalinkCreator} />, permalinkCreator={this.props.permalinkCreator} />,
showFormattingButton ? <FormattingButton key="controls_formatting" showFormattingButton ? <FormattingButton
showFormatting={this.state.showFormatting} onClickHandler={this.onToggleFormattingClicked} /> : null, key="controls_formatting"
showFormatting={this.state.showFormatting}
onClickHandler={this.onToggleFormattingClicked} /> :
null,
<Stickerpicker key='stickerpicker_controls_button' room={this.props.room} />, <Stickerpicker key='stickerpicker_controls_button' room={this.props.room} />,
<UploadButton key="controls_upload" roomId={this.props.room.roomId} />, <UploadButton key="controls_upload" roomId={this.props.room.roomId} />,
callInProgress ? <HangupButton key="controls_hangup" roomId={this.props.room.roomId} /> : null, callInProgress ? <HangupButton key="controls_hangup" roomId={this.props.room.roomId} /> : null,
@ -485,5 +488,5 @@ MessageComposer.propTypes = {
callState: PropTypes.string, callState: PropTypes.string,
// string representing the current room app drawer state // string representing the current room app drawer state
showApps: PropTypes.bool showApps: PropTypes.bool,
}; };