From 22c58b4d7d864414c599761f92212a5825003950 Mon Sep 17 00:00:00 2001 From: jackyzha0 Date: Sun, 10 May 2020 00:25:31 -0700 Subject: input length check and component splitting --- frontend/src/components/PasteArea.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'frontend/src/components/PasteArea.js') diff --git a/frontend/src/components/PasteArea.js b/frontend/src/components/PasteArea.js index fb3db64..f026ef9 100644 --- a/frontend/src/components/PasteArea.js +++ b/frontend/src/components/PasteArea.js @@ -13,6 +13,14 @@ class PasteArea extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); } + componentDidUpdate() { + if (this.state.title === "") { + document.title = `ctrl-v`; + } else { + document.title = `ctrl-v | ${this.state.title}`; + } + } + handleChange(event) { const target = event.target; const name = target.name; @@ -33,10 +41,12 @@ class PasteArea extends React.Component {
+ value={this.state.title} + maxLength="100" /> + content={this.state.content} + maxLength="100000" />
-- cgit v1.2.3