From 59a6473bed78bb22eae3ecc0cb38b7d0c14fb934 Mon Sep 17 00:00:00 2001 From: Ayushmaanagarwal1121 Date: Wed, 3 Jul 2024 23:27:31 +0530 Subject: [PATCH] Fixed Issues --- src/pages/AddFoodItem.jsx | 10 +++++----- src/pages/EditProfile.jsx | 2 +- src/pages/Foodlist.jsx | 14 ++++++++------ src/pages/Rateus.jsx | 10 ++++++---- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/pages/AddFoodItem.jsx b/src/pages/AddFoodItem.jsx index 8264ef8..ee0cd2b 100644 --- a/src/pages/AddFoodItem.jsx +++ b/src/pages/AddFoodItem.jsx @@ -103,10 +103,10 @@ function AddFoodItem() { }; return ( -
+

Add Food Item

@@ -117,7 +117,7 @@ function AddFoodItem() { name="dish" value={formData.dish} onChange={handleChange} - className="w-full p-2 border border-gray-300 rounded mt-1" + className="w-full p-2 border border-gray-300 rounded mt-1 text-black" required />
@@ -128,7 +128,7 @@ function AddFoodItem() { name="dishId" value={formData.dishId} onChange={handleChange} - className="w-full p-2 border border-gray-300 rounded mt-1" + className="w-full p-2 border border-gray-300 rounded mt-1 text-black" required />
@@ -155,7 +155,7 @@ function AddFoodItem() { name="description" value={formData.description} onChange={handleChange} - className="w-full p-2 border border-gray-300 rounded mt-1" + className="w-full p-2 border border-gray-300 rounded mt-1 text-black" rows="3" > diff --git a/src/pages/EditProfile.jsx b/src/pages/EditProfile.jsx index 00e4b72..65a718c 100644 --- a/src/pages/EditProfile.jsx +++ b/src/pages/EditProfile.jsx @@ -112,7 +112,7 @@ const EditProfile = () => { value={formData.name} disabled={!edit} onChange={handleChange} - className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" + className={`shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline `} />
diff --git a/src/pages/Foodlist.jsx b/src/pages/Foodlist.jsx index f20f816..4113905 100644 --- a/src/pages/Foodlist.jsx +++ b/src/pages/Foodlist.jsx @@ -24,8 +24,7 @@ const Foodlist = () => { try { setLoading(true); const response = await fetch( - `${process.env.REACT_APP_BASE_URL}/${_id}/${mealType}`, - { + `${process.env.REACT_APP_BASE_URL}/${_id}/${mealType}`, { method: "GET", headers: { "Content-Type": "application/json", @@ -40,7 +39,10 @@ const Foodlist = () => { setLoading(false); } }; - + function handleClose(){ + setEditModal(false) + console.log(editModal) + } const handleDelete = async (dishId, mealType) => { try { const token = localStorage.getItem("token"); @@ -135,7 +137,7 @@ const Foodlist = () => { useEffect(() => { fetchData("breakfast", setBreakfast); fetchData("lunch", setLunch); - fetchData("dinner", setDinner); + fetchData("dinner", setLunch); }, [_id]); const handleDishClick = async (dishId) => { @@ -186,7 +188,7 @@ const Foodlist = () => { }; return ( -
+
@@ -363,7 +365,7 @@ const Foodlist = () => { {editModal && ( setEditModal(false)} + onCancel={handleClose} onUpdate={handleUpdateDish} /> )} diff --git a/src/pages/Rateus.jsx b/src/pages/Rateus.jsx index 14ac6d8..43e908d 100644 --- a/src/pages/Rateus.jsx +++ b/src/pages/Rateus.jsx @@ -1,12 +1,14 @@ -import React, { useState } from 'react'; +import React, { useState,useContext } from 'react'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import Footer from "../components/Footer"; import Navbar from "../components/Navbar"; +import { ThemeContext } from "../themeContext"; const RateUs = () => { const [rating, setRating] = useState(''); const [feedback, setFeedback] = useState(''); + const { theme } = useContext(ThemeContext); const handleRatingClick = (emoji) => { setRating(emoji); @@ -32,12 +34,12 @@ const RateUs = () => { }} > -
+
-

Rate Our Website

+

Rate Our Website

{['😢', '😡', '😐', '😊', '🤩'].map((emoji) => (