From 8e3e97a3c8d283b87ac0dbd98522b5cb95165e10 Mon Sep 17 00:00:00 2001
From: Nikhil
Date: Sat, 13 Sep 2025 09:09:36 +0530
Subject: [PATCH 1/7] added my orders and my profile page
---
frontend/src/App.jsx | 48 +++++-
frontend/src/pages/MyOrder/MyOrder.css | 50 ++++++
frontend/src/pages/MyOrder/MyOrder.jsx | 190 +++++++++++++++++++++
frontend/src/pages/MyProfile/MyProfile.css | 60 +++++++
frontend/src/pages/MyProfile/MyProfile.jsx | 73 ++++++++
5 files changed, 420 insertions(+), 1 deletion(-)
create mode 100644 frontend/src/pages/MyOrder/MyOrder.css
create mode 100644 frontend/src/pages/MyOrder/MyOrder.jsx
create mode 100644 frontend/src/pages/MyProfile/MyProfile.css
create mode 100644 frontend/src/pages/MyProfile/MyProfile.jsx
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 61abd78d..0d256156 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -27,6 +27,8 @@ import ScrollToBottom from "./components/ScrollToBottomButton/ScrollToBottomButt
import ReferralProgram from "./components/Referrals/ReferralProgram";
import AboutUs from "./components/Aboutus/Aboutus";
import FAQ from "./components/FAQ/FAQ";
+import MyProfile from "./pages/MyProfile/MyProfile";
+import MyOrder from "./pages/MyOrder/MyOrder";
const App = () => {
const [showLogin, setShowLogin] = useState(false);
@@ -92,13 +94,57 @@ const App = () => {
} />
} />
} />
+ ) : (
+
+
+ Please Log In To Proceed
+
+
+ Your journey continues after login 🔐
+
+
+ )
+ } />
+ ) : (
+
+
+ Please Log In To Proceed
+
+
+ Your journey continues after login 🔐
+
+
+ )
+ } />
} />
{/* floating button */}
-
+
{/* ✅ Footer now contains FAQ */}
)}
+
);
};
diff --git a/frontend/src/pages/Restaurants/SimilarRestaurants.jsx b/frontend/src/pages/Restaurants/SimilarRestaurants.jsx
new file mode 100644
index 00000000..69071887
--- /dev/null
+++ b/frontend/src/pages/Restaurants/SimilarRestaurants.jsx
@@ -0,0 +1,129 @@
+import { Clock, MapPin, Star } from 'lucide-react'
+import React from 'react'
+import { useNavigate } from 'react-router-dom'
+import "./Restaurants.css";
+
+const SimilarRestaurants = () => {
+ const navigate = useNavigate();
+ const SimilarRestaurants = [
+ {
+ id: 1,
+ name: "White Rose",
+ image: "https://b.zmtcdn.com/data/pictures/1/2900111/bb0ff3eb4f4c5bc782e4e84aecca429b_featured_v2.jpg?output-format=webp",
+ rating: 4.5,
+ discount: "25% OFF",
+ cuisine: "Chinese",
+ deliveryTime: "40-45 min",
+ location: "Gurgaon",
+ description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
+ },
+ {
+ id: 1,
+ name: "The Fork",
+ image: "https://b.zmtcdn.com/data/pictures/6/19729416/328bd9a65a1ebde88d5f70c8e1aaf90a_featured_v2.jpg?output-format=webp",
+ rating: 4.3,
+ discount: "15% OFF",
+ cuisine: "North Indian",
+ deliveryTime: "35-40 min",
+ location: "Noida",
+ description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
+ },
+ {
+ id: 1,
+ name: "Green tea",
+ image: "https://b.zmtcdn.com/data/pictures/3/2901243/8b17b1df933b87ca0a537f2188343b2d_featured_v2.jpg?output-format=webp",
+ rating: 4.4,
+ discount: "20% OFF",
+ cuisine: "Italian",
+ deliveryTime: "20-25 min",
+ location: "Hyderabad",
+ description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
+ },
+ {
+ id: 1,
+ name: "Paris Bakry",
+ image: "https://b.zmtcdn.com/data/pictures/chains/2/19391402/baba44b8700e02256928be092a272b42_featured_v2.jpg?output-format=webp",
+ rating: 4.2,
+ discount: "30% OFF",
+ cuisine: "South Indian",
+ deliveryTime: "25-30 min",
+ location: "Bangalore",
+ description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
+ },
+
+ ]
+ const renderStars = (rating) => {
+ const stars = [];
+ const fullStars = Math.floor(rating);
+ const hasHalfStar = rating % 1 !== 0;
+
+ for (let i = 0; i < fullStars; i++) {
+ stars.push();
+ }
+
+ if (hasHalfStar) {
+ stars.push(
+
+ );
+ }
+
+ const emptyStars = 5 - Math.ceil(rating);
+ for (let i = 0; i < emptyStars; i++) {
+ stars.push();
+ }
+
+ return stars;
+ };
+ return (
+ <>
+ Similar Restaurants
+
+ {
+ SimilarRestaurants.map((restaurants) => {
+ return (
+
navigate(`/restaurant/${restaurants.id}`)}
+ style={{ cursor: "pointer" }}
+ >
+
+

+
{restaurants.discount}
+
+
+
+
+
{restaurants.name}
+
+ {renderStars(restaurants.rating)}
+ {restaurants.rating}
+
+
+
+
+
+
+ {restaurants.location}
+
+
+
+ {restaurants.deliveryTime}
+
+
+
+
{restaurants.cuisine}
+
{restaurants.description}
+
+
+
+
+ )
+ })
+ }
+
+ >
+ )
+}
+
+export default SimilarRestaurants
\ No newline at end of file
From 012c6579b09b6cd2baf7f02463719a3b93d9389f Mon Sep 17 00:00:00 2001
From: Nikhil
Date: Thu, 18 Sep 2025 13:12:18 +0530
Subject: [PATCH 7/7] add share feature for restaurants
---
.../src/pages/Restaurants/Restaurants.css | 6 +-
.../src/pages/Restaurants/Restaurants.jsx | 87 +++++++++++++++++-
.../pages/Restaurants/SimilarRestaurants.jsx | 92 +++++++++++++++++--
3 files changed, 177 insertions(+), 8 deletions(-)
diff --git a/frontend/src/pages/Restaurants/Restaurants.css b/frontend/src/pages/Restaurants/Restaurants.css
index f6b031ef..4e2e8edb 100644
--- a/frontend/src/pages/Restaurants/Restaurants.css
+++ b/frontend/src/pages/Restaurants/Restaurants.css
@@ -191,7 +191,11 @@
.order-now-btn:hover {
background-color: #e5533d;
}
-
+.share-restaurants{
+ display: flex;
+ align-items: center;
+ justify-content:space-between
+}
@keyframes FadeIn {
0% {
opacity: 0;
diff --git a/frontend/src/pages/Restaurants/Restaurants.jsx b/frontend/src/pages/Restaurants/Restaurants.jsx
index 4e5663bd..d4d4e73c 100644
--- a/frontend/src/pages/Restaurants/Restaurants.jsx
+++ b/frontend/src/pages/Restaurants/Restaurants.jsx
@@ -3,10 +3,16 @@ import "./Restaurants.css";
import { Star, MapPin, Clock } from "lucide-react";
import { useNavigate } from "react-router-dom";
import SimilarRestaurants from "./SimilarRestaurants";
+import { Dialog, DialogContent, DialogTitle, IconButton } from "@mui/material";
+import { FaSquareWhatsapp, FaSquareXTwitter, FaFacebook } from "react-icons/fa6";
+import { SiGmail } from "react-icons/si";
+import { LuShare2 } from "react-icons/lu";
+
const Restaurants = () => {
const navigate = useNavigate();
const [search, setSearch] = useState("");
+ const [open, setOpen] = useState(false);
const restaurants = [
{
@@ -55,6 +61,57 @@ const Restaurants = () => {
},
];
+ const shareUrl = window.location.href;
+ const options = [
+ {
+ icon: window.open(`https://wa.me/?text=${encodeURIComponent(shareUrl)}`)}
+ />,
+ text: "WhatsApp"
+ },
+ {
+ icon: window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
+ shareUrl
+ )}`, "_blank")}
+ />,
+ text: "Instagram"
+ },
+ {
+ icon: window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(
+ shareUrl
+ )}`)}
+ />,
+ text: "Twitter"
+ },
+ {
+ icon: window.open(`mailto:?subject=${encodeURIComponent(
+ "Check out this food on Foodie!"
+ )}&body=${encodeURIComponent(
+ `I found this food item, thought you might like it: ${shareUrl}`
+ )}`)}
+ />,
+ text: "Mail"
+ }
+ ]
+
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
// Filter restaurants by cuisine search
const filteredRestaurants = restaurants.filter((restaurant) =>
restaurant.cuisine.toLowerCase().includes(search.toLowerCase())
@@ -133,6 +190,34 @@ const Restaurants = () => {
{restaurant.deliveryTime}
+
+
{restaurants.cuisine}
+
{
+ e.stopPropagation(); // prevent parent card onClick
+ handleOpen();
+ }}
+ >
+
+
+
+
{restaurant.cuisine}
@@ -148,7 +233,7 @@ const Restaurants = () => {
)}
-
+
);
};
diff --git a/frontend/src/pages/Restaurants/SimilarRestaurants.jsx b/frontend/src/pages/Restaurants/SimilarRestaurants.jsx
index 69071887..c9665440 100644
--- a/frontend/src/pages/Restaurants/SimilarRestaurants.jsx
+++ b/frontend/src/pages/Restaurants/SimilarRestaurants.jsx
@@ -1,10 +1,16 @@
import { Clock, MapPin, Star } from 'lucide-react'
-import React from 'react'
+import React, { useState } from 'react'
import { useNavigate } from 'react-router-dom'
import "./Restaurants.css";
+import { LuShare2 } from "react-icons/lu";
+import { Dialog, DialogContent, DialogTitle, IconButton } from '@mui/material'
+import { FaSquareWhatsapp, FaSquareXTwitter, FaFacebook } from "react-icons/fa6";
+import { SiGmail } from "react-icons/si";
const SimilarRestaurants = () => {
const navigate = useNavigate();
+ const [open, setOpen] = useState(false);
+ const shareUrl = window.location.href;
const SimilarRestaurants = [
{
id: 1,
@@ -18,7 +24,7 @@ const SimilarRestaurants = () => {
description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
},
{
- id: 1,
+ id: 2,
name: "The Fork",
image: "https://b.zmtcdn.com/data/pictures/6/19729416/328bd9a65a1ebde88d5f70c8e1aaf90a_featured_v2.jpg?output-format=webp",
rating: 4.3,
@@ -29,7 +35,7 @@ const SimilarRestaurants = () => {
description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
},
{
- id: 1,
+ id: 3,
name: "Green tea",
image: "https://b.zmtcdn.com/data/pictures/3/2901243/8b17b1df933b87ca0a537f2188343b2d_featured_v2.jpg?output-format=webp",
rating: 4.4,
@@ -40,7 +46,7 @@ const SimilarRestaurants = () => {
description: "Authentic Italian cuisine with fresh ingredients and traditional recipes.",
},
{
- id: 1,
+ id: 4,
name: "Paris Bakry",
image: "https://b.zmtcdn.com/data/pictures/chains/2/19391402/baba44b8700e02256928be092a272b42_featured_v2.jpg?output-format=webp",
rating: 4.2,
@@ -52,6 +58,52 @@ const SimilarRestaurants = () => {
},
]
+ const options = [
+ {
+ icon: window.open(`https://wa.me/?text=${encodeURIComponent(shareUrl)}`)}
+ />,
+ text: "WhatsApp"
+ },
+ {
+ icon: window.open(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
+ shareUrl
+ )}`, "_blank")}
+ />,
+ text: "Instagram"
+ },
+ {
+ icon: window.open(`https://twitter.com/intent/tweet?url=${encodeURIComponent(
+ shareUrl
+ )}`)}
+ />,
+ text: "Twitter"
+ },
+ {
+ icon: window.open(`mailto:?subject=${encodeURIComponent(
+ "Check out this food on Foodie!"
+ )}&body=${encodeURIComponent(
+ `I found this food item, thought you might like it: ${shareUrl}`
+ )}`)}
+ />,
+ text: "Mail"
+ }
+ ]
const renderStars = (rating) => {
const stars = [];
const fullStars = Math.floor(rating);
@@ -74,6 +126,8 @@ const SimilarRestaurants = () => {
return stars;
};
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
return (
<>
Similar Restaurants
@@ -111,8 +165,34 @@ const SimilarRestaurants = () => {
{restaurants.deliveryTime}
-
- {restaurants.cuisine}
+
+
{restaurants.cuisine}
+
{
+ e.stopPropagation(); // prevent parent card onClick
+ handleOpen();
+ }}
+ >
+
+
+
+
{restaurants.description}