aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/NewPaste.js
diff options
context:
space:
mode:
authorRyan Mehri <[email protected]>2020-05-14 12:55:40 -0600
committerGitHub <[email protected]>2020-05-14 12:55:40 -0600
commitfcadb1bf21403f357e48542fd94c78828044e07b (patch)
tree421ab164e447c63cb163aff4f081072385d8ca4f /frontend/src/components/NewPaste.js
parentMerge pull request #20 from jackyzha0/pass-rendering (diff)
parenton new paste modal (diff)
downloadctrl-v-fcadb1bf21403f357e48542fd94c78828044e07b.tar.xz
ctrl-v-fcadb1bf21403f357e48542fd94c78828044e07b.zip
Merge pull request #22 from jackyzha0/paste-modal
on new paste modal
Diffstat (limited to 'frontend/src/components/NewPaste.js')
-rw-r--r--frontend/src/components/NewPaste.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/frontend/src/components/NewPaste.js b/frontend/src/components/NewPaste.js
index f48f48b..0b1c795 100644
--- a/frontend/src/components/NewPaste.js
+++ b/frontend/src/components/NewPaste.js
@@ -1,9 +1,9 @@
import React from 'react';
import { TitleInput, PasteInput } from './Inputs'
import OptionsContainer from './Options'
-import { Redirect } from 'react-router-dom'
import Error from './Err'
import { PostNewPaste } from '../helpers/httpHelper'
+import PasteModal from './modals/PasteModal'
class NewPaste extends React.Component {
constructor(props) {
@@ -22,13 +22,6 @@ class NewPaste extends React.Component {
this.ErrorLabel = React.createRef();
}
- renderRedirect = () => {
- if (this.state.hash !== '') {
- const redirUrl = `/${this.state.hash}`
- return <Redirect to={redirUrl} />
- }
- }
-
componentDidUpdate() {
if (this.state.title === "") {
document.title = `ctrl-v`;
@@ -69,7 +62,7 @@ class NewPaste extends React.Component {
render() {
return (
<form onSubmit={this.handleSubmit}>
- {this.renderRedirect()}
+ <PasteModal hash={this.state.hash} />
<TitleInput
onChange={this.handleChange}
value={this.state.title}