Commit d28d6553 authored by PiTrem's avatar PiTrem
Browse files

default content for Quill viewer

prevent breaking
also fx proptype
parent 8fbb7702
import React from 'react';
import ReactDOM from 'react-dom';
import PropTypes from 'prop-types';
import Quill from 'quill';
import Delta from 'quill-delta';
......@@ -256,18 +257,18 @@ export default class QuillEditor extends React.Component {
}
QuillEditor.propTypes = {
value: React.PropTypes.object,
customToolbar: React.PropTypes.object,
toolbarSymbol: React.PropTypes.array,
theme: React.PropTypes.string,
height: React.PropTypes.string,
disabled: React.PropTypes.bool,
onChange: React.PropTypes.func,
value: PropTypes.object,
customToolbar: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
toolbarSymbol: PropTypes.array,
theme: PropTypes.string,
height: PropTypes.string,
disabled: PropTypes.bool,
onChange: PropTypes.func,
};
QuillEditor.defaultProps = {
value: {},
customToolbar: "",
customToolbar: '',
toolbarSymbol: [],
theme: 'snow',
height: '230px',
......
......@@ -150,7 +150,7 @@ const HeaderNormal = ({ sample, container, mode, readOnly, isDisabled, serial,
const kind = container.extended_metadata.kind || '';
const status = container.extended_metadata.status || '';
const previewImg = previewImage(container);
const content = container.extended_metadata.content;
const content = container.extended_metadata.content || { ops: [{ insert: '' }] };
const contentOneLine = {
ops: content.ops.map((x) => {
const c = Object.assign({}, x);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment