diff options
| author | Ryan Mehri <[email protected]> | 2020-05-09 23:07:01 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-09 23:07:01 -0600 |
| commit | 716e0b2633f14e13930c688f49859018dd01c592 (patch) | |
| tree | d00576287ced311b9eec10dd4bb5a516fbd91124 /frontend/src/components/PasteArea.js | |
| parent | Merge pull request #6 from jackyzha0/backend (diff) | |
| parent | change from npm to yarn (diff) | |
| download | ctrl-v-716e0b2633f14e13930c688f49859018dd01c592.tar.xz ctrl-v-716e0b2633f14e13930c688f49859018dd01c592.zip | |
Merge pull request #7 from jackyzha0/react
add basic root page
Diffstat (limited to 'frontend/src/components/PasteArea.js')
| -rw-r--r-- | frontend/src/components/PasteArea.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/frontend/src/components/PasteArea.js b/frontend/src/components/PasteArea.js new file mode 100644 index 0000000..f7c060c --- /dev/null +++ b/frontend/src/components/PasteArea.js @@ -0,0 +1,35 @@ +import React from 'react'; + +class PasteArea extends React.Component { + constructor(props) { + super(props); + this.state = { + value: '' + }; + + this.handleChange = this.handleChange.bind(this); + this.handleSubmit = this.handleSubmit.bind(this); + } + + handleChange(event) { + this.setState({ value: event.target.value }); + } + + handleSubmit(event) { + alert('paste content: ' + this.state.value); + event.preventDefault(); + } + + render() { + return ( + <form onSubmit={this.handleSubmit}> + <textarea placeholder="Paste your text here" + value={this.state.value} onChange={this.handleChange} className="lt-shadow"/> + <br></br> + <input className="lt-button lt-shadow lt-hover" type="submit" value="new paste" /> + </form> + ); + } +} + +export default PasteArea
\ No newline at end of file |