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

@ -133,7 +133,7 @@ const BaseAvatar = (props: IProps) => {
aria-hidden="true" /> aria-hidden="true" />
); );
if (onClick != null) { if (onClick !== null) {
return ( return (
<AccessibleButton <AccessibleButton
{...otherProps} {...otherProps}
@ -161,7 +161,7 @@ const BaseAvatar = (props: IProps) => {
} }
} }
if (onClick != null) { if (onClick !== null) {
return ( return (
<AccessibleButton <AccessibleButton
className={classNames("mx_BaseAvatar mx_BaseAvatar_image", props.className)} className={classNames("mx_BaseAvatar mx_BaseAvatar_image", props.className)}

View File

@ -19,13 +19,13 @@ import {MatrixClientPeg} from '../../../MatrixClientPeg';
import BaseAvatar from './BaseAvatar'; import BaseAvatar from './BaseAvatar';
export interface IProps { export interface IProps {
groupId?: string, groupId?: string;
groupName?: string, groupName?: string;
groupAvatarUrl?: string, groupAvatarUrl?: string;
width?: number, width?: number;
height?: number, height?: number;
resizeMethod?: string, resizeMethod?: string;
onClick?: React.MouseEventHandler, onClick?: React.MouseEventHandler;
} }
export default class GroupAvatar extends React.Component<IProps> { 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) { constructor(props: IProps) {
super(props); super(props);
this.state = MemberAvatar.getState(props) this.state = MemberAvatar.getState(props);
} }
public static getDerivedStateFromProps(nextProps: IProps): IState { public static getDerivedStateFromProps(nextProps: IProps): IState {

View File

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

View File

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

View File

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

View File

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

View File

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