From 418fbb8817dc22c6235811d256137139c70023b6 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Fri, 22 May 2020 23:53:55 -0700 Subject: latex live preview --- frontend/src/components/NewPaste.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'frontend/src/components') 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 = + var preview + switch (this.state.language) { + case 'latex': + preview = + + + + break + default: + preview = + + } if (this.state.preview) { return ( -- cgit v1.2.3