From 13b21c0cf255e0148e134f2814afa71f1ab56c1c Mon Sep 17 00:00:00 2001 From: Peter Georgas Date: Thu, 28 Oct 2021 23:34:21 -0400 Subject: [PATCH] Added button to redirect user back to upload page --- src/App.js | 6 +++++- src/components/Success.css | 12 ++++++++++++ src/components/Success.js | 7 ++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 53e4c47..cdf0ddf 100644 --- a/src/App.js +++ b/src/App.js @@ -73,6 +73,10 @@ function App() { } }); + const newUpload = () => { + setSuccess(false); // Reset success state to false, which will cause a redirect to the home page + }; + const handleFileChange = (event) => { console.log("File change!!"); let target = event.target; @@ -139,7 +143,7 @@ function App() { if (inProg) { return ; } else if (success) { - return ; + return ; } else { return (
diff --git a/src/components/Success.css b/src/components/Success.css index 37912cb..7897a18 100644 --- a/src/components/Success.css +++ b/src/components/Success.css @@ -16,6 +16,18 @@ padding-left: 10px; } +.new-upload-box { + margin-top: 12px; + line-height: 16px; + width: 355px; + height: 34px; + border-radius: 8px; +} + +#newUpldBtn { + width: 100%; +} + .link-box { display: flex; flex-direction: row; diff --git a/src/components/Success.js b/src/components/Success.js index f423306..9880de1 100644 --- a/src/components/Success.js +++ b/src/components/Success.js @@ -11,7 +11,7 @@ const SnackbarType = { function Success(props) { const snackbarRef = useRef(null); - const { imgUrl } = props; + const { imgUrl, redirect } = props; const copyLink = () => { snackbarRef.current.show(); @@ -46,6 +46,11 @@ function Success(props) { type={SnackbarType.success} />
+
+ +