Merge pull request #91 from Mavrin/master

Adds eslint check and fixes linting issues
This commit is contained in:
Igor Adamenko
2018-06-23 12:18:41 +03:00
committed by GitHub
15 changed files with 2837 additions and 3334 deletions
+2 -4
View File
@@ -24,9 +24,7 @@ export default class AuthPanel extends Component {
toggleBlockedVisibility() {
if (!this.state.isBlockedVisible) {
if (this.props.onBlockedUsersShow) this.props.onBlockedUsersShow();
} else {
if (this.props.onBlockedUsersHide) this.props.onBlockedUsersHide();
}
} else if (this.props.onBlockedUsersHide) this.props.onBlockedUsersHide();
this.setState({ isBlockedVisible: !this.state.isBlockedVisible });
}
@@ -70,7 +68,7 @@ export default class AuthPanel extends Component {
onClick={() => props.onSignIn(provider)}
>{PROVIDER_NAMES[provider]}</span>
</span>
)
);
})
}
{'.'}
@@ -1,6 +1,6 @@
import { h, Component } from 'preact';
import api from 'common/api'
import api from 'common/api';
export default class BlockedUsers extends Component {
constructor(props) {
@@ -8,7 +8,7 @@ export default class BlockedUsers extends Component {
this.state = {
unblockedUsers: [],
}
};
}
block(user) {
@@ -73,7 +73,7 @@ export default class BlockedUsers extends Component {
)
}
</li>
)
);
})
}
</ul>
+2 -2
View File
@@ -331,8 +331,8 @@ export default class Comment extends Component {
? 'This user was blocked'
: (
deleted
? 'This comment was deleted'
: data.text
? 'This comment was deleted'
: data.text
)
),
time: formatTime(new Date(data.time)),
+3 -3
View File
@@ -22,7 +22,7 @@ export default class Root extends Component {
try {
sort = localStorage.getItem(LS_SORT_KEY) || DEFAULT_SORT;
} catch(e) {
} catch (e) {
sort = DEFAULT_SORT;
}
@@ -117,7 +117,7 @@ export default class Root extends Component {
store.set('user', user);
this.setState({ user });
})
.catch(() => {}) // TODO: we need to handle it and write error to user
.catch(() => {}); // TODO: we need to handle it and write error to user
}
}, checkMsDelay);
}
@@ -178,7 +178,7 @@ export default class Root extends Component {
});
}
render({}, { config = {}, comments = [], user, sort, isLoaded, isBlockedVisible, isCommentsListLoading, bannedUsers, commentsShown }) {
render(props, { config = {}, comments = [], user, sort, isLoaded, isBlockedVisible, isCommentsListLoading, bannedUsers, commentsShown }) {
if (!isLoaded) {
return (
<div id={NODE_ID}>