Skip to content

Commit c68c546

Browse files
committed
delint
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 3788fde commit c68c546

1 file changed

Lines changed: 27 additions & 31 deletions

File tree

‎src/components/structures/RightPanel.js‎

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import sdk from 'matrix-react-sdk';
2424
import dis from 'matrix-react-sdk/lib/dispatcher';
2525
import { MatrixClient } from 'matrix-js-sdk';
2626
import Analytics from 'matrix-react-sdk/lib/Analytics';
27-
import rate_limited_func from 'matrix-react-sdk/lib/ratelimitedfunc';
27+
import RateLimitedFunc from 'matrix-react-sdk/lib/ratelimitedfunc';
2828
import AccessibleButton from 'matrix-react-sdk/lib/components/views/elements/AccessibleButton';
2929
import { showGroupInviteDialog, showGroupAddRoomDialog } from 'matrix-react-sdk/lib/GroupAddressPicker';
3030
import GroupStoreCache from 'matrix-react-sdk/lib/stores/GroupStoreCache';
@@ -58,8 +58,8 @@ class HeaderButton extends React.Component {
5858
<div className="mx_RightPanel_headerButton_badge">
5959
{ this.props.badge ? this.props.badge : <span>&nbsp;</span> }
6060
</div>
61-
<TintableSvg src={this.props.iconSrc} width="25" height="25"/>
62-
{ this.props.isHighlighted ? <div className="mx_RightPanel_headerButton_highlight"></div> : <div/> }
61+
<TintableSvg src={this.props.iconSrc} width="25" height="25" />
62+
{ this.props.isHighlighted ? <div className="mx_RightPanel_headerButton_highlight" /> : <div /> }
6363

6464
</AccessibleButton>;
6565
}
@@ -184,18 +184,17 @@ module.exports = React.createClass({
184184

185185
onRoomStateMember: function(ev, state, member) {
186186
// redraw the badge on the membership list
187-
if (this.state.phase == this.Phase.RoomMemberList && member.roomId === this.props.roomId) {
187+
if (this.state.phase === this.Phase.RoomMemberList && member.roomId === this.props.roomId) {
188188
this._delayedUpdate();
189-
}
190-
else if (this.state.phase === this.Phase.RoomMemberInfo && member.roomId === this.props.roomId &&
189+
} else if (this.state.phase === this.Phase.RoomMemberInfo && member.roomId === this.props.roomId &&
191190
member.userId === this.state.member.userId) {
192191
// refresh the member info (e.g. new power level)
193192
this._delayedUpdate();
194193
}
195194
},
196195

197-
_delayedUpdate: new rate_limited_func(function() {
198-
this.forceUpdate();
196+
_delayedUpdate: new RateLimitedFunc(function() {
197+
this.forceUpdate(); // eslint-disable-line babel/no-invalid-this
199198
}, 500),
200199

201200
onAction: function(payload) {
@@ -267,7 +266,7 @@ module.exports = React.createClass({
267266

268267
let membersBadge;
269268
let membersTitle = _t('Members');
270-
if ((this.state.phase == this.Phase.RoomMemberList || this.state.phase === this.Phase.RoomMemberInfo)
269+
if ((this.state.phase === this.Phase.RoomMemberList || this.state.phase === this.Phase.RoomMemberInfo)
271270
&& this.props.roomId
272271
) {
273272
const cli = this.context.matrixClient;
@@ -282,7 +281,7 @@ module.exports = React.createClass({
282281

283282
if (userIsInRoom) {
284283
inviteGroup =
285-
<AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
284+
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteButtonClick}>
286285
<div className="mx_RightPanel_icon" >
287286
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
288287
</div>
@@ -293,7 +292,7 @@ module.exports = React.createClass({
293292

294293
const isPhaseGroup = [
295294
this.Phase.GroupMemberInfo,
296-
this.Phase.GroupMemberList
295+
this.Phase.GroupMemberList,
297296
].includes(this.state.phase);
298297

299298
let headerButtons = [];
@@ -337,54 +336,54 @@ module.exports = React.createClass({
337336
// button on these 2 screens or you won't be able to re-expand the panel.
338337
headerButtons.push(
339338
<div className="mx_RightPanel_headerButton mx_RightPanel_collapsebutton" key="_minimizeButton"
340-
title={ _t("Hide panel") } aria-label={ _t("Hide panel") } onClick={ this.onCollapseClick }
339+
title={_t("Hide panel")} aria-label={_t("Hide panel")} onClick={this.onCollapseClick}
341340
>
342-
<TintableSvg src="img/minimise.svg" width="10" height="16"/>
341+
<TintableSvg src="img/minimise.svg" width="10" height="16" />
343342
</div>,
344343
);
345344
}
346345

347346
let panel = <div />;
348347
if (!this.props.collapsed) {
349-
if (this.props.roomId && this.state.phase == this.Phase.RoomMemberList) {
348+
if (this.props.roomId && this.state.phase === this.Phase.RoomMemberList) {
350349
panel = <MemberList roomId={this.props.roomId} key={this.props.roomId} />;
351-
} else if (this.props.groupId && this.state.phase == this.Phase.GroupMemberList) {
350+
} else if (this.props.groupId && this.state.phase === this.Phase.GroupMemberList) {
352351
panel = <GroupMemberList groupId={this.props.groupId} key={this.props.groupId} />;
353352
} else if (this.state.phase === this.Phase.GroupRoomList) {
354353
panel = <GroupRoomList groupId={this.props.groupId} key={this.props.groupId} />;
355-
} else if (this.state.phase == this.Phase.RoomMemberInfo) {
354+
} else if (this.state.phase === this.Phase.RoomMemberInfo) {
356355
panel = <MemberInfo member={this.state.member} key={this.props.roomId || this.state.member.userId} />;
357-
} else if (this.state.phase == this.Phase.GroupMemberInfo) {
356+
} else if (this.state.phase === this.Phase.GroupMemberInfo) {
358357
panel = <GroupMemberInfo
359358
groupMember={this.state.member}
360359
groupId={this.props.groupId}
361360
key={this.state.member.user_id} />;
362-
} else if (this.state.phase == this.Phase.GroupRoomInfo) {
361+
} else if (this.state.phase === this.Phase.GroupRoomInfo) {
363362
panel = <GroupRoomInfo
364363
groupRoomId={this.state.groupRoomId}
365364
groupId={this.props.groupId}
366365
key={this.state.groupRoomId} />;
367-
} else if (this.state.phase == this.Phase.NotificationPanel) {
366+
} else if (this.state.phase === this.Phase.NotificationPanel) {
368367
panel = <NotificationPanel />;
369-
} else if (this.state.phase == this.Phase.FilePanel) {
368+
} else if (this.state.phase === this.Phase.FilePanel) {
370369
panel = <FilePanel roomId={this.props.roomId} />;
371370
}
372371
}
373372

374373
if (!panel) {
375-
panel = <div className="mx_RightPanel_blank"></div>;
374+
panel = <div className="mx_RightPanel_blank" />;
376375
}
377376

378377
if (this.props.groupId && this.state.isUserPrivilegedInGroup) {
379378
inviteGroup = isPhaseGroup ? (
380-
<AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
379+
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteButtonClick}>
381380
<div className="mx_RightPanel_icon" >
382381
<TintableSvg src="img/icon-invite-people.svg" width="35" height="35" />
383382
</div>
384383
<div className="mx_RightPanel_message">{ _t('Invite to this community') }</div>
385384
</AccessibleButton>
386385
) : (
387-
<AccessibleButton className="mx_RightPanel_invite" onClick={ this.onInviteButtonClick } >
386+
<AccessibleButton className="mx_RightPanel_invite" onClick={this.onInviteButtonClick}>
388387
<div className="mx_RightPanel_icon" >
389388
<TintableSvg src="img/icons-room-add.svg" width="35" height="35" />
390389
</div>
@@ -393,19 +392,16 @@ module.exports = React.createClass({
393392
);
394393
}
395394

396-
let classes = classNames(
397-
"mx_RightPanel", "mx_fadable",
398-
{
399-
"collapsed": this.props.collapsed,
400-
"mx_fadable_faded": this.props.disabled,
401-
}
402-
);
395+
const classes = classNames("mx_RightPanel", "mx_fadable", {
396+
"collapsed": this.props.collapsed,
397+
"mx_fadable_faded": this.props.disabled,
398+
});
403399

404400
return (
405401
<aside className={classes}>
406402
<div className="mx_RightPanel_header">
407403
<div className="mx_RightPanel_headerButtonGroup">
408-
{headerButtons}
404+
{ headerButtons }
409405
</div>
410406
</div>
411407
{ panel }

0 commit comments

Comments
 (0)