Add Prettier Formatting (#258)

* Add Prettier formatting to source files and example files, and check that Prettier formatting is maintained on PRs

* Remove trailing-comma as we are using Node 6 on Circle

* Use latest Node 6 LTS version in Circle

* Remove unused test
This commit is contained in:
Héctor Ramos 2017-12-04 19:21:02 -08:00 committed by Joel Marcey
parent 0cead4b6f9
commit 65421db62e
50 changed files with 1376 additions and 1350 deletions

View file

@ -5,32 +5,32 @@
* LICENSE file in the root directory of this source tree.
*/
const React = require("react");
const classNames = require("classnames");
const React = require('react');
const classNames = require('classnames');
const MarkdownBlock = require("./MarkdownBlock.js");
const MarkdownBlock = require('./MarkdownBlock.js');
class GridBlock extends React.Component {
renderBlock(block) {
const blockClasses = classNames("blockElement", this.props.className, {
alignCenter: this.props.align === "center",
alignRight: this.props.align === "right",
fourByGridBlock: this.props.layout === "fourColumn",
imageAlignBottom: block.image && block.imageAlign === "bottom",
const blockClasses = classNames('blockElement', this.props.className, {
alignCenter: this.props.align === 'center',
alignRight: this.props.align === 'right',
fourByGridBlock: this.props.layout === 'fourColumn',
imageAlignBottom: block.image && block.imageAlign === 'bottom',
imageAlignSide:
block.image &&
(block.imageAlign === "left" || block.imageAlign === "right"),
imageAlignTop: block.image && block.imageAlign === "top",
threeByGridBlock: this.props.layout === "threeColumn",
twoByGridBlock: this.props.layout === "twoColumn"
(block.imageAlign === 'left' || block.imageAlign === 'right'),
imageAlignTop: block.image && block.imageAlign === 'top',
threeByGridBlock: this.props.layout === 'threeColumn',
twoByGridBlock: this.props.layout === 'twoColumn',
});
const topLeftImage =
(block.imageAlign === "top" || block.imageAlign === "left") &&
(block.imageAlign === 'top' || block.imageAlign === 'left') &&
this.renderBlockImage(block.image, block.imageLink);
const bottomRightImage =
(block.imageAlign === "bottom" || block.imageAlign === "right") &&
(block.imageAlign === 'bottom' || block.imageAlign === 'right') &&
this.renderBlockImage(block.image, block.imageLink);
return (
@ -38,9 +38,7 @@ class GridBlock extends React.Component {
{topLeftImage}
<div className="blockContent">
{this.renderBlockTitle(block.title)}
<MarkdownBlock>
{block.content}
</MarkdownBlock>
<MarkdownBlock>{block.content}</MarkdownBlock>
</div>
{bottomRightImage}
</div>
@ -73,9 +71,7 @@ class GridBlock extends React.Component {
if (title) {
return (
<h2>
<MarkdownBlock>
{title}
</MarkdownBlock>
<MarkdownBlock>{title}</MarkdownBlock>
</h2>
);
} else {
@ -93,10 +89,10 @@ class GridBlock extends React.Component {
}
GridBlock.defaultProps = {
align: "left",
align: 'left',
contents: [],
imagealign: "top",
layout: "twoColumn"
imagealign: 'top',
layout: 'twoColumn',
};
module.exports = GridBlock;