From ac708de910d03183903a25db0dc614f8cfb8950a Mon Sep 17 00:00:00 2001 From: Michael Winsauer Date: Sat, 19 Jan 2019 03:34:28 +0100 Subject: [PATCH] Add place holder PDF link --- .../src/components/SentimentAnalysis.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/service-website/src/components/SentimentAnalysis.js b/service-website/src/components/SentimentAnalysis.js index 5e7ba3f..9a234d3 100644 --- a/service-website/src/components/SentimentAnalysis.js +++ b/service-website/src/components/SentimentAnalysis.js @@ -9,6 +9,7 @@ class SentimentAnalysis extends Component { this.state = { terms: new Map().set(0, ''), nextTermId: 1, + pdfLink: null, }; this.handleSubmit = this.handleSubmit.bind(this); this.handleTermChange = this.handleTermChange.bind(this); @@ -75,12 +76,28 @@ class SentimentAnalysis extends Component { .then(response => { const data = response.data; console.log(data); + this.setState({ + pdfLink: 'https://google.at', + }); }) .catch(error => { console.log(error); }); } + renderPdf() { + const pdfLink = this.state.pdfLink; + if (pdfLink) { + return ( +
+ Download PDF report +
+ ); + } else { + return null; + } + } + render() { return (
@@ -92,6 +109,7 @@ class SentimentAnalysis extends Component { onRemoveTerm={this.handleRemoveTerm}/> + {this.renderPdf()}
); } -- 2.43.0