From ee9bb1e9249079379ceff3b031296e284aedc872 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Mon, 11 May 2020 23:29:46 -0700 Subject: working no pass rendering --- frontend/src/components/Err.js | 2 +- frontend/src/components/ViewPaste.js | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'frontend/src') 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 (); + } + } + render() { return (
@@ -43,10 +57,9 @@ class ViewPaste extends React.Component { value={this.state.title} id="titleInput" readOnly /> - + + {this.drawRightMode()} + @@ -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, -- cgit v1.2.3