Run Prettier

This commit is contained in:
Frank Li 2017-07-10 16:38:35 -07:00
parent a7b5148e06
commit fbae29b0ff
29 changed files with 1311 additions and 987 deletions

View file

@ -7,26 +7,35 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
const Marked = require('./Marked.js');
const React = require('react');
const Marked = require("./Marked.js");
const React = require("react");
class BlogPost extends React.Component {
renderContent() {
let content = this.props.content;
if (this.props.truncate) {
content = content.split('<!--truncate-->')[0];
content = content.split("<!--truncate-->")[0];
return (
<article className="post-content">
<Marked>{content}</Marked>
<Marked>
{content}
</Marked>
<div className="read-more">
<a className="button" href={this.props.config.baseUrl + 'blog/' + this.props.post.path}>
<a
className="button"
href={this.props.config.baseUrl + "blog/" + this.props.post.path}
>
Read More
</a>
</div>
</article>
);
}
return <Marked>{content}</Marked>;
return (
<Marked>
{content}
</Marked>
);
}
renderAuthorPhoto() {
@ -37,9 +46,9 @@ class BlogPost extends React.Component {
<a href={post.authorURL} target="_blank">
<img
src={
'https://graph.facebook.com/' +
post.authorFBID +
'/picture/?height=200&width=200'
"https://graph.facebook.com/" +
post.authorFBID +
"/picture/?height=200&width=200"
}
/>
</a>
@ -54,7 +63,9 @@ class BlogPost extends React.Component {
const post = this.props.post;
return (
<h1>
<a href={this.props.config.baseUrl + 'blog/' + post.path}>{post.title}</a>
<a href={this.props.config.baseUrl + "blog/" + post.path}>
{post.title}
</a>
</h1>
);
}
@ -65,18 +76,18 @@ class BlogPost extends React.Component {
// Because JavaScript sucks at date handling :(
const year = match[1];
const month = [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
][parseInt(match[2], 10) - 1];
const day = parseInt(match[3], 10);
@ -84,7 +95,9 @@ class BlogPost extends React.Component {
<header className="postHeader">
{this.renderAuthorPhoto()}
<p className="post-authorName">
<a href={post.authorURL} target="_blank">{post.author}</a>
<a href={post.authorURL} target="_blank">
{post.author}
</a>
</p>
{this.renderTitle()}
<p className="post-meta">