From a929efccf0a0c338f5c4e5d0471931bf93b862c6 Mon Sep 17 00:00:00 2001 From: dev129 <76431221+dev129@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:25:56 +0530 Subject: [PATCH 1/3] Incenetive Offfers --- frontend/src/App.jsx | 8 ++- frontend/src/components/Shared/Navbar.jsx | 2 +- frontend/src/components/Shared/Offers.jsx | 87 +++++++++++++++++++++++ 3 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/Shared/Offers.jsx diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index c5a927fb..4805fcf1 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,15 +1,19 @@ // src/App.js import './App.css'; +import React from 'react'; +import { useState } from 'react'; import Navbar from '../src/components/Shared/Navbar'; import Footer from '../src/components/Shared/Footer'; import { Outlet } from 'react-router-dom'; import BackToTopButton from './components/Shared/BackToTopButton'; import Preloader from './components/Preloader'; - +import Offers from './components/Shared/Offers' function App() { + const [showModal, setShowModal] = useState(true); return ( <> + setShowModal(false)} /> @@ -18,4 +22,4 @@ function App() { ); } -export default App; +export default App; \ No newline at end of file diff --git a/frontend/src/components/Shared/Navbar.jsx b/frontend/src/components/Shared/Navbar.jsx index e74f284b..e8317316 100644 --- a/frontend/src/components/Shared/Navbar.jsx +++ b/frontend/src/components/Shared/Navbar.jsx @@ -70,7 +70,7 @@ const Navbar = () => { return ( diff --git a/frontend/src/components/Shared/Offers.jsx b/frontend/src/components/Shared/Offers.jsx new file mode 100644 index 00000000..ad8b4df7 --- /dev/null +++ b/frontend/src/components/Shared/Offers.jsx @@ -0,0 +1,87 @@ +import React, { useEffect } from 'react'; +import { RxCross1 } from "react-icons/rx"; +import { useNavigate } from 'react-router-dom'; // Import useNavigate from react-router-dom + +const Offers = ({ isVisible, onClose }) => { + const navigate = useNavigate(); // Initialize the useNavigate hook + + // useEffect to add/remove class to body for disabling scroll when modal is visible + useEffect(() => { + if (isVisible) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = 'auto'; + } + return () => { + document.body.style.overflow = 'auto'; + }; + }, [isVisible]); + + if (!isVisible) return null; // Modal is only visible when isVisible is true + + // Function to handle redirect and modal close + const handleTakeMeThere = () => { + onClose(); // Close the modal first + navigate('/menu'); // Then navigate to /menu + }; + + return ( + + + + {/* Close Button */} + onClose()} // onClick event to trigger onClose + > + + + + {/* Modal Content in two sections */} + + {/* Left Section: Image */} + + + + + {/* Right Section: Text and Buttons */} + + {/* Title */} + + So what are you waiting for? + Grab the Offer now! + + + {/* Buttons */} + + {/* No thanks button (left) */} + onClose()} // Close modal on No thanks + > + No thanks + + + {/* Yes, Take Me There button (right) */} + + Take Me There + + + + + + + {/* Backdrop blur layer */} + + + ); +}; + +export default Offers; From e2ad349f4409bbf0983687cd882ef304de1df97b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:56:47 +0000 Subject: [PATCH 2/3] docs(contributor): contrib-readme-action has updated readme --- README.md | 68 ++++++++++++++++++++++--------------------------------- 1 file changed, 27 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 865dac71..4f6ade4f 100644 --- a/README.md +++ b/README.md @@ -140,20 +140,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Arindam - - - - - Ashwini_ab - - - - - - - Mahera Nayan - - @@ -161,13 +147,11 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Tejas Benibagde - - - - + + - Tyarla Shirisha + Ashwini_ab @@ -177,6 +161,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Haseeb Zaki + + @@ -184,13 +170,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Suhas Koheda - - - - - Vishnu Prasad Korada - - @@ -199,14 +178,12 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 - - + + - Aman Yadav + Vishnu Prasad Korada - - @@ -214,6 +191,13 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Abhijit Motekar + + + + + Mahera Nayan + + @@ -221,6 +205,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Navneet Dadhich + + @@ -243,19 +229,17 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 - - + + - MANI + Ayush Yadav - - - - + + - Ayush Yadav + Aman Yadav @@ -265,6 +249,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Ali Gates + + @@ -293,8 +279,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Mohit Rana - - @@ -309,6 +293,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Nilanchal + + From 8184d3639af560ca622005f64ca6464a3f111ff7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 02:26:51 +0000 Subject: [PATCH 3/3] docs(contributor): contrib-readme-action has updated readme --- README.md | 9 --------- 1 file changed, 9 deletions(-) diff --git a/README.md b/README.md index 20bba32f..4f6ade4f 100644 --- a/README.md +++ b/README.md @@ -302,13 +302,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Sapna Kul - - - - - Sourabh Singh Rawat - - @@ -323,8 +316,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Syed Faraz - -