This commit is contained in:
Tom Moor
2017-11-05 22:48:31 -08:00
parent 14326d89f2
commit 51bc705488
10 changed files with 252 additions and 203 deletions

View File

@@ -16,10 +16,15 @@ import {
Heading6,
} from './components/Heading';
import Paragraph from './components/Paragraph';
import BlockToolbar from './components/BlockToolbar';
import BlockToolbar from './components/Toolbar/BlockToolbar';
import type { Props, Node, Transform } from './types';
const createSchema = () => {
type Options = {
onInsertImage: Function,
onChange: Function,
};
const createSchema = ({ onInsertImage, onChange }: Options) => {
return {
marks: {
bold: (props: Props) => <strong>{props.children}</strong>,
@@ -31,7 +36,13 @@ const createSchema = () => {
},
nodes: {
'block-toolbar': (props: Props) => <BlockToolbar {...props} />,
'block-toolbar': (props: Props) => (
<BlockToolbar
onChange={onChange}
onInsertImage={onInsertImage}
{...props}
/>
),
paragraph: (props: Props) => <Paragraph {...props} />,
'block-quote': (props: Props) => (
<blockquote>{props.children}</blockquote>