diff options
| author | jackyzha0 <[email protected]> | 2020-05-23 10:59:31 -0700 |
|---|---|---|
| committer | jackyzha0 <[email protected]> | 2020-05-23 10:59:31 -0700 |
| commit | f4cb08e7a1eaebf3c60506e3a4941c903619c448 (patch) | |
| tree | a29777c693a02ec0b0bd2713979272f3b155e67f /frontend/src/components/ViewPaste.js | |
| parent | wip render dispatch (diff) | |
| download | ctrl-v-f4cb08e7a1eaebf3c60506e3a4941c903619c448.tar.xz ctrl-v-f4cb08e7a1eaebf3c60506e3a4941c903619c448.zip | |
fix more styling problems
Diffstat (limited to 'frontend/src/components/ViewPaste.js')
| -rw-r--r-- | frontend/src/components/ViewPaste.js | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js index 00348a5..30fb29e 100644 --- a/frontend/src/components/ViewPaste.js +++ b/frontend/src/components/ViewPaste.js @@ -6,6 +6,7 @@ import PasteInfo from './PasteInfo'; import PasswordModal from './modals/PasswordModal' import { FetchPaste, FetchPasswordPaste } from '../helpers/httpHelper' import { LANGS } from './renderers/Code' +import RenderDispatch from './renderers/RenderDispatch' class ViewPaste extends React.Component { @@ -80,10 +81,23 @@ class ViewPaste extends React.Component { render() { - // var display - // if (this.state.isRenderMode) { - - // } + var display + if (this.state.isRenderMode) { + display = + <RenderDispatch + language={this.state.language} + content={this.state.content} + ref={this.componentRef} + /> + } else { + display = + <CodeRenderer + content={this.state.content} + lang={this.state.language} + theme={this.state.theme} + ref={this.componentRef} + id="pasteInput" /> + } return ( <div> @@ -98,12 +112,7 @@ class ViewPaste extends React.Component { value={this.state.title} id="titleInput" readOnly /> - <CodeRenderer - content={this.state.content} - lang={this.state.language} - theme={this.state.theme} - ref={this.componentRef} - id="pasteInput" /> + {display} <PasteInfo hash={this.props.hash} lang={this.state.language} |