Migrate conversations to ESLint
This commit is contained in:
parent
b4f0f3c685
commit
372aa44e49
90 changed files with 1261 additions and 1165 deletions
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue