Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat incentive offers #325

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 47 additions & 121 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,29 +214,6 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Arindam</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/alo7lika">
<img src="https://avatars.githubusercontent.com/u/152315710?v=4" width="100;" alt="alo7lika"/>
<br />
<sub><b>alolika bhowmik</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Ashwinib26">
<img src="https://avatars.githubusercontent.com/u/149402720?v=4" width="100;" alt="Ashwinib26"/>
<br />
<sub><b>Ashwini_ab</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/itznayan">
<img src="https://avatars.githubusercontent.com/u/136584376?v=4" width="100;" alt="itznayan"/>
<br />
<sub><b>Mahera Nayan</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/tejasbenibagde">
<img src="https://avatars.githubusercontent.com/u/124677750?v=4" width="100;" alt="tejasbenibagde"/>
Expand All @@ -245,24 +222,10 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</a>
</td>
<td align="center">
<a href="https://github.com/Shirisha-16">
<img src="https://avatars.githubusercontent.com/u/148051550?v=4" width="100;" alt="Shirisha-16"/>
<br />
<sub><b>Tyarla Shirisha</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Amnyadav">
<img src="https://avatars.githubusercontent.com/u/127370497?v=4" width="100;" alt="Amnyadav"/>
<br />
<sub><b>Aman Yadav</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/NilanchalaPanda">
<img src="https://avatars.githubusercontent.com/u/110488337?v=4" width="100;" alt="NilanchalaPanda"/>
<a href="https://github.com/Ashwinib26">
<img src="https://avatars.githubusercontent.com/u/149402720?v=4" width="100;" alt="Ashwinib26"/>
<br />
<sub><b>Nilanchal</b></sub>
<sub><b>Ashwini_ab</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -272,20 +235,20 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Haseeb Zaki</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Suhas-Koheda">
<img src="https://avatars.githubusercontent.com/u/72063139?v=4" width="100;" alt="Suhas-Koheda"/>
<br />
<sub><b>Suhas Koheda</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Jay-1409">
<img src="https://avatars.githubusercontent.com/u/166749819?v=4" width="100;" alt="Jay-1409"/>
<a href="https://github.com/sajalbatra">
<img src="https://avatars.githubusercontent.com/u/125984550?v=4" width="100;" alt="sajalbatra"/>
<br />
<sub><b>Jay shah</b></sub>
<sub><b>Sajal Batra</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -296,24 +259,17 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</a>
</td>
<td align="center">
<a href="https://github.com/sajalbatra">
<img src="https://avatars.githubusercontent.com/u/125984550?v=4" width="100;" alt="sajalbatra"/>
<br />
<sub><b>Sajal Batra</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/PavanTeja2005">
<img src="https://avatars.githubusercontent.com/u/98730339?v=4" width="100;" alt="PavanTeja2005"/>
<a href="https://github.com/AbhijitMotekar99">
<img src="https://avatars.githubusercontent.com/u/109235675?v=4" width="100;" alt="AbhijitMotekar99"/>
<br />
<sub><b>PavanTeja2005</b></sub>
<sub><b>Abhijit Motekar</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/AbhijitMotekar99">
<img src="https://avatars.githubusercontent.com/u/109235675?v=4" width="100;" alt="AbhijitMotekar99"/>
<a href="https://github.com/itznayan">
<img src="https://avatars.githubusercontent.com/u/136584376?v=4" width="100;" alt="itznayan"/>
<br />
<sub><b>Abhijit Motekar</b></sub>
<sub><b>Mahera Nayan</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -325,63 +281,12 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Sawan-Kushwah">
<img src="https://avatars.githubusercontent.com/u/138680328?v=4" width="100;" alt="Sawan-Kushwah"/>
<br />
<sub><b>Sawan kushwah </b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/VinayLodhi1712">
<img src="https://avatars.githubusercontent.com/u/135756009?v=4" width="100;" alt="VinayLodhi1712"/>
<br />
<sub><b>Vinay Anand Lodhi</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/lade6501">
<img src="https://avatars.githubusercontent.com/u/83055827?v=4" width="100;" alt="lade6501"/>
<br />
<sub><b>Vishal Lade</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/REHAN-18">
<img src="https://avatars.githubusercontent.com/u/143922855?v=4" width="100;" alt="REHAN-18"/>
<br />
<sub><b>MD REHAN</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Aditya90456">
<img src="https://avatars.githubusercontent.com/u/153073510?v=4" width="100;" alt="Aditya90456"/>
<br />
<sub><b>Aditya Bakshi</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/tanishirai">
<img src="https://avatars.githubusercontent.com/u/178164785?v=4" width="100;" alt="tanishirai"/>
<br />
<sub><b>Tanishi Rai</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Picodes10">
<img src="https://avatars.githubusercontent.com/u/91375618?v=4" width="100;" alt="Picodes10"/>
<br />
<sub><b>Sushree Manaswini Biswal</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Sourabh782">
<img src="https://avatars.githubusercontent.com/u/103349890?v=4" width="100;" alt="Sourabh782"/>
<br />
<sub><b>Sourabh Singh Rawat</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Shiva-Bajpai">
Expand All @@ -391,10 +296,10 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</a>
</td>
<td align="center">
<a href="https://github.com/devxMani">
<img src="https://avatars.githubusercontent.com/u/122438942?v=4" width="100;" alt="devxMani"/>
<a href="https://github.com/Sawan-Kushwah">
<img src="https://avatars.githubusercontent.com/u/138680328?v=4" width="100;" alt="Sawan-Kushwah"/>
<br />
<sub><b>MANI </b></sub>
<sub><b>Sawan kushwah </b></sub>
</a>
</td>
<td align="center">
Expand All @@ -404,6 +309,13 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Ayush Yadav</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Amnyadav">
<img src="https://avatars.githubusercontent.com/u/127370497?v=4" width="100;" alt="Amnyadav"/>
<br />
<sub><b>Aman Yadav</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/AliGates915">
<img src="https://avatars.githubusercontent.com/u/128673394?v=4" width="100;" alt="AliGates915"/>
Expand All @@ -413,13 +325,6 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/chikatlarakesh">
<img src="https://avatars.githubusercontent.com/u/178009894?v=4" width="100;" alt="chikatlarakesh"/>
<br />
<sub><b>CHIKATLA RAKESH</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mishradev1">
<img src="https://avatars.githubusercontent.com/u/118660840?v=4" width="100;" alt="mishradev1"/>
Expand All @@ -434,6 +339,13 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Jai Dhingra</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Jay-1409">
<img src="https://avatars.githubusercontent.com/u/166749819?v=4" width="100;" alt="Jay-1409"/>
<br />
<sub><b>Jay shah</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Mohitranag18">
<img src="https://avatars.githubusercontent.com/u/152625405?v=4" width="100;" alt="Mohitranag18"/>
Expand All @@ -448,15 +360,22 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<sub><b>Bashua Mutiat</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/NilanchalaPanda">
<img src="https://avatars.githubusercontent.com/u/110488337?v=4" width="100;" alt="NilanchalaPanda"/>
<br />
<sub><b>Nilanchal</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Sapna127">
<img src="https://avatars.githubusercontent.com/u/91309280?v=4" width="100;" alt="Sapna127"/>
<br />
<sub><b>Sapna Kul</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/stutxi">
<img src="https://avatars.githubusercontent.com/u/95741837?v=4" width="100;" alt="stutxi"/>
Expand All @@ -477,6 +396,13 @@ We extend our heartfelt gratitude to all the amazing contributors who have made
<br />
<sub><b>Vaibhav-Kumar-K-R</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/dev129">
<img src="https://avatars.githubusercontent.com/u/76431221?v=4" width="100;" alt="dev129"/>
<br />
<sub><b>dev129</b></sub>
</a>
</td>
</tr>
<tbody>
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<>
<Preloader />
<Offers isVisible={showModal} onClose={() => setShowModal(false)} />
<BackToTopButton />
<Navbar />
<Outlet />
Expand All @@ -18,4 +22,4 @@ function App() {
);
}

export default App;
export default App;
2 changes: 1 addition & 1 deletion frontend/src/components/Shared/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const Navbar = () => {

return (
<nav
className={`w-full fixed top-0 z-50 transition duration-300 ${
className={`w-full fixed top-0 z-20 transition duration-300 ${
isScrolled ? 'bg-[#E0F0B1]' : 'bg-transparent'
} ${isScrolled ? 'text-gray-800' : 'text-black'} ${isScrolled ? 'shadow-lg' : ''}`}
>
Expand Down
87 changes: 87 additions & 0 deletions frontend/src/components/Shared/Offers.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className='fixed inset-0 bg-white bg-opacity-25 backdrop-blur-lg flex justify-center items-center z-30'>
<div className='w-[600px] flex p-4 rounded-lg shadow-lg bg-white relative z-20'>

{/* Close Button */}
<button
className="absolute top-2 right-2 text-black text-xl"
onClick={() => onClose()} // onClick event to trigger onClose
>
<RxCross1 color='black' />
</button>

{/* Modal Content in two sections */}
<div className="flex flex-row w-full">
{/* Left Section: Image */}
<div className="w-1/2">
<img
src="https://www.leocoffee.co.in/cdn/shop/files/F0470AC5-D46D-4112-834D-7C5C1F9EF9CF.jpg?v=1673668314"
alt="Offer"
className="rounded-lg object-cover h-full w-full"
/>
</div>

{/* Right Section: Text and Buttons */}
<div className="w-1/2 flex flex-col justify-center px-4">
{/* Title */}
<h2 className="text-2xl font-bold mb-4 text-black">
So what are you waiting for? <br />
Grab the Offer now!
</h2>

{/* Buttons */}
<div className="flex justify-between mt-4 gap-2 ">
{/* No thanks button (left) */}
<button
className="bg-[#f5deb3] text-black py-2 px-4 rounded-lg hover:bg-[#eed19b] transition"
onClick={() => onClose()} // Close modal on No thanks
>
No thanks
</button>

{/* Yes, Take Me There button (right) */}
<button
className="bg-[#d2b48c] text-black py-2 px-4 rounded-lg hover:bg-[#c8a682] transition"
onClick={handleTakeMeThere} // Handle both close and navigation
>
Take Me There
</button>
</div>
</div>
</div>
</div>

{/* Backdrop blur layer */}
<div className='absolute inset-0 bg-black bg-opacity-50 backdrop-blur-sm z-0'></div>
</div>
);
};

export default Offers;