mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-13 00:57:53 +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
|
@ -48,37 +48,33 @@ class GridBlock extends React.Component {
|
|||
}
|
||||
|
||||
renderBlockImage(image, imageLink, imageAlt) {
|
||||
if (image) {
|
||||
if (imageLink) {
|
||||
return (
|
||||
<div className="blockImage">
|
||||
<a href={imageLink}>
|
||||
<img src={image} alt={imageAlt} />
|
||||
</a>
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<div className="blockImage">
|
||||
<img src={image} alt={imageAlt} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!image) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="blockImage">
|
||||
{imageLink ? (
|
||||
<a href={imageLink}>
|
||||
<img src={image} alt={imageAlt} />
|
||||
</a>
|
||||
) : (
|
||||
<img src={image} alt={imageAlt} />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderBlockTitle(title) {
|
||||
if (title) {
|
||||
return (
|
||||
<h2>
|
||||
<MarkdownBlock>{title}</MarkdownBlock>
|
||||
</h2>
|
||||
);
|
||||
} else {
|
||||
if (!title) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<h2>
|
||||
<MarkdownBlock>{title}</MarkdownBlock>
|
||||
</h2>
|
||||
);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue