diff options
Diffstat (limited to 'frontend/src')
| -rw-r--r-- | frontend/src/components/NewPaste.js | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/frontend/src/components/NewPaste.js b/frontend/src/components/NewPaste.js index e1075c4..615dc2a 100644 --- a/frontend/src/components/NewPaste.js +++ b/frontend/src/components/NewPaste.js @@ -7,6 +7,7 @@ import PasteModal from './modals/PasteModal' import { LANGS } from './renderers/Code' import styled from 'styled-components' import CodeRenderer from './renderers/Code' +import Latex from './renderers/Latex' const Button = styled.button` margin-right: 0 !important; @@ -29,6 +30,11 @@ const FlexRight = styled.div` margin-left: 2em; ` +const LatexWrapper = styled.div` + margin-top: 2em; + margin-bottom: 2em; +` + class NewPaste extends React.Component { constructor(props) { super(props); @@ -103,10 +109,22 @@ class NewPaste extends React.Component { maxLength="100000" id="pasteInput" /> - const preview = <CodeRenderer - lang={this.state.language} - theme='atom' - content={this.state.content} /> + var preview + switch (this.state.language) { + case 'latex': + preview = + <LatexWrapper> + <Latex + content={this.state.content} /> + </LatexWrapper> + break + default: + preview = + <CodeRenderer + lang={this.state.language} + theme='atom' + content={this.state.content} /> + } if (this.state.preview) { return ( |