mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-16 10:37:20 +02:00
ESLintify Part 1 (#837)
* ESLint-ify * Allow empty try/catch * Escape regexp
This commit is contained in:
parent
128dbfca0a
commit
e8e3f42685
44 changed files with 466 additions and 555 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue