Migrate conversations to ESLint

This commit is contained in:
Chris Svenningsen 2020-09-14 12:51:27 -07:00 committed by Josh Perez
parent b4f0f3c685
commit 372aa44e49
90 changed files with 1261 additions and 1165 deletions

View file

@ -31,9 +31,8 @@ export class MediaGridItem extends React.Component<Props, State> {
this.onImageErrorBound = this.onImageError.bind(this);
}
public onImageError() {
// tslint:disable-next-line no-console
console.log(
public onImageError(): void {
window.log.info(
'MediaGridItem: Image failed to load; failing over to placeholder'
);
this.setState({
@ -41,7 +40,7 @@ export class MediaGridItem extends React.Component<Props, State> {
});
}
public renderContent() {
public renderContent(): JSX.Element | null {
const { mediaItem, i18n } = this.props;
const { imageBroken } = this.state;
const { attachment, contentType } = mediaItem;
@ -70,7 +69,8 @@ export class MediaGridItem extends React.Component<Props, State> {
onError={this.onImageErrorBound}
/>
);
} else if (contentType && isVideoTypeSupported(contentType)) {
}
if (contentType && isVideoTypeSupported(contentType)) {
if (imageBroken || !mediaItem.thumbnailObjectUrl) {
return (
<div
@ -107,9 +107,15 @@ export class MediaGridItem extends React.Component<Props, State> {
);
}
public render() {
public render(): JSX.Element {
const { onClick } = this.props;
return (
<button className="module-media-grid-item" onClick={this.props.onClick}>
<button
type="button"
className="module-media-grid-item"
onClick={onClick}
>
{this.renderContent()}
</button>
);