From 156f21622cd55b1eee68809b27d59e41dc2e1e12 Mon Sep 17 00:00:00 2001 From: akhilesh Date: Mon, 5 Jun 2023 17:37:35 +0530 Subject: [PATCH 1/2] added feedback section --- src/App.jsx | 10 ++++ src/components/Feedback/Feedback.jsx | 84 ++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 src/components/Feedback/Feedback.jsx diff --git a/src/App.jsx b/src/App.jsx index 5ecff9cc..485e1a2e 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -7,6 +7,7 @@ import Signup from "./components/Signup"; import Profile from "./components/Profile"; import Home from "./pages/Home"; import Movie from "./pages/Movie"; +import Feedback from "./components/Feedback/Feedback"; import Categories from "./pages/Categories"; import { UserAuthContextProvider } from "./context/authContext"; import ProtectedRoute from "./components/ProtectedRoute"; @@ -54,6 +55,15 @@ function App() { } /> + + + + } + /> { + const [email, setEmail] = useState(''); + const [submitted, setSubmitted] = useState(false); + const [feedback, setFeedback] = useState(''); + emailjs.init('1AkXF-PC-6FG2Ym15'); + + const handleSubmit = (e) => { + e.preventDefault(); + + const templateParams = { + feedback: feedback, + to_email: 'harshupadhye2832@gmail.com', + from_email: email + }; + emailjs + .send('service_c8wox7q', 'template_47lh3vm', templateParams, '1AkXF-PC-6FG2Ym15') + .then((response) => { + console.log('Feedback sent!', response.status, response.text); + setSubmitted(true); + setFeedback(''); + setEmail(''); + }) + .catch((error) => { + console.error('Error sending feedback:', error); + }); + }; + + return ( +
+
+