fix: missing default value for grid block content objects (#1186)

This commit is contained in:
Marvin Chin 2019-01-16 16:31:27 +08:00 committed by Yangshun Tay
parent e31ecdfd0c
commit 4dcd6840c3

View file

@ -11,7 +11,16 @@ const classNames = require('classnames');
const MarkdownBlock = require('./MarkdownBlock.js');
class GridBlock extends React.Component {
renderBlock(block) {
renderBlock(origBlock) {
const blockDefaults = {
imageAlign: 'left',
};
const block = {
...blockDefaults,
...origBlock,
};
const blockClasses = classNames('blockElement', this.props.className, {
alignCenter: this.props.align === 'center',
alignRight: this.props.align === 'right',