diff --git a/frontend/src/components/DownloadForm.js b/frontend/src/components/DownloadForm.js
index 091948e..ab6ebda 100644
--- a/frontend/src/components/DownloadForm.js
+++ b/frontend/src/components/DownloadForm.js
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from "react";
import axios from "axios";
import { v4 as uuidv4 } from "uuid";
import Confetti from "react-confetti";
+import Notification from "./Notification";
const DownloadForm = () => {
const [url, setUrl] = useState("");
@@ -10,6 +11,7 @@ const DownloadForm = () => {
const [progress, setProgress] = useState(0);
const [isDownloading, setIsDownloading] = useState(false);
const [showConfetti, setShowConfetti] = useState(false);
+ const [notification, setNotification] = useState(null);
const isValidYouTubeUrl = (url) => {
const youtubeRegex = /^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.be)\/.+$/;
@@ -20,10 +22,10 @@ const DownloadForm = () => {
e.preventDefault();
if (!url) {
- setMessage("maybe enter an URL first");
+ setNotification("Maybe enter an URL first");
return;
} else if (!isValidYouTubeUrl(url)) {
- setMessage("doesn't look like YouTube to me");
+ setNotification("Doesn't look like YouTube to me");
return;
}
@@ -162,13 +164,13 @@ const DownloadForm = () => {
{!isDownloading && !message.startsWith("Downloading") && (
)}
- {" "}
+
{showConfetti && (
@@ -185,6 +187,12 @@ const DownloadForm = () => {
/>
)}
+ {notification && (
+ setNotification(null)}
+ />
+ )}
+
+ );
+};
+
+export default Notification;