aboutsummaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorjackyzha0 <[email protected]>2020-05-11 23:29:46 -0700
committerjackyzha0 <[email protected]>2020-05-11 23:29:46 -0700
commitee9bb1e9249079379ceff3b031296e284aedc872 (patch)
tree3feeaf278a3970ea0d6e9a153edadb0fc7f30ebd /frontend/src
parentfmt info component (diff)
downloadctrl-v-ee9bb1e9249079379ceff3b031296e284aedc872.tar.xz
ctrl-v-ee9bb1e9249079379ceff3b031296e284aedc872.zip
working no pass rendering
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/components/Err.js2
-rw-r--r--frontend/src/components/ViewPaste.js22
2 files changed, 18 insertions, 6 deletions
diff --git a/frontend/src/components/Err.js b/frontend/src/components/Err.js
index f1891d0..8562a74 100644
--- a/frontend/src/components/Err.js
+++ b/frontend/src/components/Err.js
@@ -2,7 +2,7 @@ import React from 'react';
import styled from 'styled-components'
const ErrMsg = styled.p`
- display: inline-block;
+ display: inline;
font-weight: 700;
margin-left: 2em;
color: #ff3333
diff --git a/frontend/src/components/ViewPaste.js b/frontend/src/components/ViewPaste.js
index bba0219..79b1840 100644
--- a/frontend/src/components/ViewPaste.js
+++ b/frontend/src/components/ViewPaste.js
@@ -36,6 +36,20 @@ class ViewPaste extends React.Component {
}
}
+ drawRightMode() {
+ switch (this.state.mode) {
+ // TODO: add other renderers
+
+ // default render raw
+ case RENDER_MODES.RAW:
+ default:
+ return (<PasteInput
+ content={this.state.content}
+ id="pasteInput"
+ readOnly />);
+ }
+ }
+
render() {
return (
<div>
@@ -43,10 +57,9 @@ class ViewPaste extends React.Component {
value={this.state.title}
id="titleInput"
readOnly />
- <PasteInput
- content={this.state.content}
- id="pasteInput"
- readOnly />
+
+ {this.drawRightMode()}
+
<PasteInfo
expiry={this.state.expiry}
mode={this.state.mode} />
@@ -67,7 +80,6 @@ class ViewPaste extends React.Component {
axios.get(serverURL)
.then((response) => {
const data = response.data
- console.log(this.fmtDateStr(data.expiry))
this.setState({
title: data.title,
content: data.content,