Lint whitespaces and semis

pull/21833/head
Jorik Schellekens 2020-07-07 15:40:05 +01:00
parent 8458572032
commit bc4167180c
9 changed files with 43 additions and 44 deletions

View File

@ -93,10 +93,10 @@ const BaseAvatar = (props: IProps) => {
title,
url,
urls,
width=40,
height=40,
resizeMethod="crop", // eslint-disable-line no-unused-vars
defaultToInitialLetter=true,
width = 40,
height = 40,
resizeMethod = "crop", // eslint-disable-line no-unused-vars
defaultToInitialLetter = true,
onClick,
inputRef,
...otherProps
@ -133,7 +133,7 @@ const BaseAvatar = (props: IProps) => {
aria-hidden="true" />
);
if (onClick != null) {
if (onClick !== null) {
return (
<AccessibleButton
{...otherProps}
@ -161,7 +161,7 @@ const BaseAvatar = (props: IProps) => {
}
}
if (onClick != null) {
if (onClick !== null) {
return (
<AccessibleButton
className={classNames("mx_BaseAvatar mx_BaseAvatar_image", props.className)}

View File

@ -19,13 +19,13 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg';
import BaseAvatar from './BaseAvatar';
export interface IProps {
groupId?: string,
groupName?: string,
groupAvatarUrl?: string,
width?: number,
height?: number,
resizeMethod?: string,
onClick?: React.MouseEventHandler,
groupId?: string;
groupName?: string;
groupAvatarUrl?: string;
width?: number;
height?: number;
resizeMethod?: string;
onClick?: React.MouseEventHandler;
}
export default class GroupAvatar extends React.Component<IProps> {

View File

@ -52,7 +52,7 @@ export default class MemberAvatar extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
this.state = MemberAvatar.getState(props)
this.state = MemberAvatar.getState(props);
}
public static getDerivedStateFromProps(nextProps: IProps): IState {

View File

@ -22,7 +22,7 @@ interface IProps {
const PulsedAvatar: React.FC<IProps> = (props) => {
return <div className="mx_PulsedAvatar">
{props.children}
</div>
}
</div>;
};
export default PulsedAvatar;

View File

@ -53,7 +53,7 @@ export default class RoomAvatar extends React.Component<IProps, IState> {
this.state = {
urls: RoomAvatar.getImageUrls(this.props),
}
};
}
public componentDidMount() {
@ -83,7 +83,7 @@ export default class RoomAvatar extends React.Component<IProps, IState> {
this.setState({
urls: RoomAvatar.getImageUrls(this.props),
});
}
};
private static getImageUrls(props: IProps): string[] {
return [
@ -98,7 +98,7 @@ export default class RoomAvatar extends React.Component<IProps, IState> {
), // highest priority
RoomAvatar.getRoomAvatarUrl(props),
].filter(function(url) {
return (url != null && url != "");
return (url !== null && url !== "");
});
}
@ -123,7 +123,7 @@ export default class RoomAvatar extends React.Component<IProps, IState> {
};
Modal.createDialog(ImageView, params, "mx_Dialog_lightbox");
}
};
public render() {
/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/

View File

@ -32,6 +32,6 @@ export default class CallContainer extends React.PureComponent<IProps, IState> {
return <div className="mx_CallContainer">
<IncomingCallBox2 />
<CallPreview ConferenceHandler={VectorConferenceHandler} />
</div>
</div>;
}
}

View File

@ -69,7 +69,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
this.roomStoreToken.remove();
}
dis.unregister(this.dispatcherRef);
SettingsStore.unwatchSetting(this.settingsWatcherRef)
SettingsStore.unwatchSetting(this.settingsWatcherRef);
}
private onRoomViewStoreUpdate = (payload) => {
@ -77,7 +77,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
this.setState({
roomId: RoomViewStore.getRoomId(),
});
}
};
private onAction = (payload: ActionPayload) => {
switch (payload.action) {
@ -89,7 +89,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
});
break;
}
}
};
private onCallViewClick = () => {
const call = CallHandler.getAnyActiveCall();
@ -99,7 +99,7 @@ export default class CallPreview extends React.Component<IProps, IState> {
room_id: call.groupRoomId || call.roomId,
});
}
}
};
public render() {
if (this.state.newRoomListActive) {

View File

@ -31,29 +31,28 @@ import PulsedAvatar from '../avatars/PulsedAvatar';
interface IProps {
// js-sdk room object. If set, we will only show calls for the given
// room; if not, we will show any active call.
room?: Room,
room?: Room;
// A Conference Handler implementation
// Must have a function signature:
// getConferenceCallForRoom(roomId: string): MatrixCall
ConferenceHandler?: any,
ConferenceHandler?: any;
// maxHeight style attribute for the video panel
maxVideoHeight?: number,
maxVideoHeight?: number;
// a callback which is called when the user clicks on the video div
onClick?: React.MouseEventHandler,
onClick?: React.MouseEventHandler;
// a callback which is called when the content in the callview changes
// in a way that is likely to cause a resize.
onResize?: any,
onResize?: any;
// classname applied to view,
className?: string,
className?: string;
// Whether to show the hang up icon:W
showHangup?: boolean,
showHangup?: boolean;
}
interface IState {
@ -71,7 +70,7 @@ export default class CallView extends React.Component<IProps, IState> {
this.state = {
// the call this view is displaying (if any)
call: null,
}
};
this.videoref = createRef();
}
@ -92,7 +91,7 @@ export default class CallView extends React.Component<IProps, IState> {
return;
}
this.showCall();
}
};
private showCall() {
let call;
@ -154,7 +153,7 @@ export default class CallView extends React.Component<IProps, IState> {
public render() {
let view: React.ReactNode;
if (this.state.call && this.state.call.type === "voice") {
const client = MatrixClientPeg.get()
const client = MatrixClientPeg.get();
const callRoom = client.getRoom(this.state.call.roomId);
view = <AccessibleButton className="mx_CallView2_voice" onClick={this.props.onClick}>
@ -189,7 +188,7 @@ export default class CallView extends React.Component<IProps, IState> {
room_id: this.state.call.roomId,
});
}}
/>
/>;
}
return <div className={this.props.className}>

View File

@ -41,10 +41,10 @@ export default class IncomingCallBox2 extends React.Component<IProps, IState> {
constructor(props: IProps) {
super(props);
this.dispatcherRef = dis.register(this.onAction)
this.dispatcherRef = dis.register(this.onAction);
this.state = {
incomingCall: null,
}
};
}
public componentWillUnmount() {
@ -54,7 +54,7 @@ export default class IncomingCallBox2 extends React.Component<IProps, IState> {
private onAction = (payload: ActionPayload) => {
switch (payload.action) {
case 'call_state':
var call = CallHandler.getCall(payload.room_id);
const call = CallHandler.getCall(payload.room_id);
if (call && call.call_state === 'ringing') {
this.setState({
incomingCall: call,
@ -65,7 +65,7 @@ export default class IncomingCallBox2 extends React.Component<IProps, IState> {
});
}
}
}
};
private onAnswerClick: React.MouseEventHandler = (e) => {
e.stopPropagation();
@ -73,7 +73,7 @@ export default class IncomingCallBox2 extends React.Component<IProps, IState> {
action: 'answer',
room_id: this.state.incomingCall.roomId,
});
}
};
private onRejectClick: React.MouseEventHandler = (e) => {
e.stopPropagation();
@ -81,7 +81,7 @@ export default class IncomingCallBox2 extends React.Component<IProps, IState> {
action: 'hangup',
room_id: this.state.incomingCall.roomId,
});
}
};
public render() {
if (!this.state.incomingCall) {