Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Extract canvas-based editor into separate chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHenninger committed Feb 19, 2018
1 parent c3f2e34 commit 1f62f88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react-dnd": "^2.1.4",
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^16.0.0",
"react-loadable": "^5.3.1",
"react-modal": "^3.2.1",
"react-monaco-editor": "^0.12.0",
"react-redux": "^5.0.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import React from 'react'
import PropTypes from 'prop-types'
import Loadable from 'react-loadable'

import Card from '../../../../Card'
import CanvasEditor from './editor'

import { updateComponent } from '../../../../../actions/components'

const LoadableEditor = Loadable({
loader: () => import('./editor'),
loading() {
return <div className="text-center">
<i className="fas fa-spinner-third fa-spin my-3" />
</div>
}
})

const Editor = ({ id, data }, { store }) =>
<Card title="Content">
<CanvasEditor
<LoadableEditor
data={ data.content }
onChange={
newData => store.dispatch(
Expand Down

0 comments on commit 1f62f88

Please sign in to comment.