aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/NewPaste.js
diff options
context:
space:
mode:
authorJacky Zhao <[email protected]>2020-05-28 19:07:21 -0700
committerGitHub <[email protected]>2020-05-28 19:07:21 -0700
commit4b1df09664793d70857b489119915be70f531da0 (patch)
tree7eebdd82b4a58c5c0d96455e257757da1e1c73da /frontend/src/components/NewPaste.js
parentMerge pull request #42 from jackyzha0/analytics (diff)
parenty helper function when no helper function do (diff)
downloadctrl-v-4b1df09664793d70857b489119915be70f531da0.tar.xz
ctrl-v-4b1df09664793d70857b489119915be70f531da0.zip
Merge pull request #43 from jackyzha0/markdown
Markdown
Diffstat (limited to 'frontend/src/components/NewPaste.js')
-rw-r--r--frontend/src/components/NewPaste.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/frontend/src/components/NewPaste.js b/frontend/src/components/NewPaste.js
index f332be0..afe1fc3 100644
--- a/frontend/src/components/NewPaste.js
+++ b/frontend/src/components/NewPaste.js
@@ -8,6 +8,7 @@ import { LANGS } from './renderers/Code'
import styled from 'styled-components'
import CodeRenderer from './renderers/Code'
import Latex from './renderers/Latex'
+import Markdown from './renderers/Markdown'
const Button = styled.button`
margin-right: 0 !important;
@@ -30,7 +31,7 @@ const FlexRight = styled.div`
margin-left: 2em;
`
-const LatexWrapper = styled.div`
+const PreviewWrapper = styled.div`
margin: 2em;
`
@@ -121,10 +122,17 @@ class NewPaste extends React.Component {
switch (this.state.language) {
case 'latex':
preview =
- <LatexWrapper>
+ <PreviewWrapper>
<Latex
content={this.state.content} />
- </LatexWrapper>
+ </PreviewWrapper>
+ break
+ case 'markdown':
+ preview =
+ <PreviewWrapper>
+ <Markdown
+ content={this.state.content} />
+ </PreviewWrapper>
break
default:
preview =