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/ViewPaste.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'frontend/src/components/ViewPaste.js') 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