Clean up and smaller bundle.js
This commit is contained in:
@@ -25,7 +25,6 @@ class DocumentEdit extends Component {
|
||||
|
||||
EditorLoader()
|
||||
.then(({ Editor }) => {
|
||||
console.log("loaded", Editor);
|
||||
this.setState({ Editor });
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { observable, action, computed, autorun } from 'mobx';
|
||||
import { client } from 'utils/ApiClient';
|
||||
import localforage from 'localforage';
|
||||
import { convertToMarkdown } from 'utils/markdown';
|
||||
import { browserHistory } from 'react-router'
|
||||
|
||||
const DOCUMENT_EDIT_SETTINGS = 'DOCUMENT_EDIT_SETTINGS';
|
||||
@@ -24,15 +23,6 @@ const documentEditState = new class DocumentEditState {
|
||||
@observable isFetching;
|
||||
@observable isSaving;
|
||||
|
||||
/* Computed */
|
||||
|
||||
@computed get htmlPreview() {
|
||||
// Only compute if preview is active
|
||||
if (this.preview) {
|
||||
return convertToMarkdown(this.text);
|
||||
}
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
|
||||
@action fetchDocument = async () => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { convertToMarkdown } from 'utils/markdown';
|
||||
|
||||
import MarkdownEditor from 'components/MarkdownEditor';
|
||||
import Preview from './Preview';
|
||||
@@ -27,7 +28,7 @@ const Editor = observer((props) => {
|
||||
<EditorPane
|
||||
scrollTop={ props.scrollTop }
|
||||
>
|
||||
<Preview html={ store.htmlPreview } />
|
||||
<Preview html={ store.text } />
|
||||
</EditorPane>
|
||||
) : null }
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ const cx = classNames.bind(styles);
|
||||
const Preview = (props) => {
|
||||
return (
|
||||
<div className={ styles.preview }>
|
||||
<DocumentHtml html={ props.html } />
|
||||
<DocumentHtml html={ props.html } />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user