ESLintify Part 1 (#837)

* ESLint-ify

* Allow empty try/catch

* Escape regexp
This commit is contained in:
Yangshun Tay 2018-07-08 09:13:18 -07:00 committed by GitHub
parent 128dbfca0a
commit e8e3f42685
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 466 additions and 555 deletions

View file

@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/
const MarkdownBlock = require('./MarkdownBlock.js');
const React = require('react');
const MarkdownBlock = require('./MarkdownBlock.js');
const utils = require('./utils.js');
// inner blog component for the article itself, without sidebar/header/footer
@ -46,32 +46,21 @@ class BlogPost extends React.Component {
const className =
'authorPhoto' +
(post.author && post.authorTitle ? ' authorPhotoBig' : '');
if (post.authorFBID) {
if (post.authorFBID || post.authorImageURL) {
const authorImageURL = post.authorFBID
? `https://graph.facebook.com/${
post.authorFBID
}/picture/?height=200&width=200`
: post.authorImageURL;
return (
<div className={className}>
<a href={post.authorURL} target="_blank" rel="noreferrer noopener">
<img
src={
'https://graph.facebook.com/' +
post.authorFBID +
'/picture/?height=200&width=200'
}
alt={post.author}
/>
<img src={authorImageURL} alt={post.author} />
</a>
</div>
);
} else if (post.authorImageURL) {
return (
<div className={className}>
<a href={post.authorURL} target="_blank" rel="noreferrer noopener">
<img src={post.authorImageURL} />
</a>
</div>
);
} else {
return null;
}
return null;
}
renderTitle() {