lift formatting up

master
Lucas Duailibe 2018-04-17 10:28:35 -03:00
parent ce81ae134c
commit 79a3ec1a04
1 changed files with 56 additions and 56 deletions

View File

@ -98,6 +98,14 @@ class Playground extends React.Component {
<VersionLink version={this.state.version} />
<EditorState>
{editorState => (
<PrettierFormat
worker={this._worker}
code={content}
options={options}
debugAst={editorState.showAst}
debugDoc={editorState.showDoc}
>
{({ formatted, debugAst, debugDoc }) => (
<React.Fragment>
<div className="editors-container">
<Sidebar visible={editorState.showSidebar}>
@ -125,14 +133,6 @@ class Playground extends React.Component {
</Button>
</div>
</Sidebar>
<PrettierFormat
worker={this._worker}
code={content}
options={options}
debugAst={editorState.showAst}
debugDoc={editorState.showDoc}
>
{({ formatted, debugAst, debugDoc }) => (
<div className="editors">
<InputPanel
mode={getCodemirrorMode(options.parser)}
@ -152,8 +152,6 @@ class Playground extends React.Component {
rulerColumn={options.printWidth}
/>
</div>
)}
</PrettierFormat>
</div>
<div className="bottom-bar">
<div className="bottom-bar-buttons">
@ -174,6 +172,8 @@ class Playground extends React.Component {
</div>
</React.Fragment>
)}
</PrettierFormat>
)}
</EditorState>
</React.Fragment>
);