diff options
Diffstat (limited to 'frontend/src/components/PasteArea.js')
| -rw-r--r-- | frontend/src/components/PasteArea.js | 14 |
1 files changed, 12 insertions, 2 deletions
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 { <form onSubmit={this.handleSubmit}> <TitleInput onChange={this.handleChange} - value={this.state.title} /> + value={this.state.title} + maxLength="100" /> <PasteInput onChange={this.handleChange} - content={this.state.content} /> + content={this.state.content} + maxLength="100000" /> <br /> <input className="lt-button lt-shadow lt-hover" type="submit" value="new paste" /> </form> |