lift formatting up
parent
ce81ae134c
commit
79a3ec1a04
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue