From d7327fefa26c58f3c23e6afe47018d13e8080089 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 2 May 2018 23:12:13 -0700 Subject: [PATCH] Upgrade styled-components Restore async editor loading --- app/scenes/Document/Document.js | 44 ++++++++++++++++++++++----------- package.json | 4 +-- yarn.lock | 28 +++------------------ 3 files changed, 35 insertions(+), 41 deletions(-) diff --git a/app/scenes/Document/Document.js b/app/scenes/Document/Document.js index 4f48cbe76..6748a1739 100644 --- a/app/scenes/Document/Document.js +++ b/app/scenes/Document/Document.js @@ -2,12 +2,12 @@ import * as React from 'react'; import get from 'lodash/get'; import styled from 'styled-components'; +import breakpoint from 'styled-components-breakpoint'; import { observable } from 'mobx'; import { observer, inject } from 'mobx-react'; import { withRouter, Prompt } from 'react-router-dom'; import type { Location } from 'react-router-dom'; import keydown from 'react-keydown'; -import Editor from 'rich-markdown-editor'; import Flex from 'shared/components/Flex'; import { collectionUrl, @@ -129,8 +129,8 @@ class DocumentScene extends React.Component { }; loadEditor = async () => { - // const EditorImport = await import('rich-markdown-editor'); - // this.editorComponent = EditorImport.default; + const EditorImport = await import('rich-markdown-editor'); + this.editorComponent = EditorImport.default; }; get isEditing() { @@ -206,7 +206,7 @@ class DocumentScene extends React.Component { } render() { - // const Editor = this.editorComponent; + const Editor = this.editorComponent; const isMoving = this.props.match.path === matchDocumentMove; const document = this.document; const titleText = @@ -234,16 +234,20 @@ class DocumentScene extends React.Component { message={DISCARD_CHANGES} /> )} - + + + {document && (