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

Fixed Design issues with dark mode and add dish page #405

Merged
merged 3 commits into from
Jul 7, 2024
Merged
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
10 changes: 5 additions & 5 deletions src/pages/AddFoodItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ function AddFoodItem() {
};

return (
<div className={`flex justify-center items-center h-[80vh] ${theme === 'dark' ? 'bg-[#131b33]' : 'bg-white'}`}>
<div className={`flex justify-center items-center h-[auto] ${theme === 'dark' ? 'bg-[#131b33]' : 'bg-white'}`}>
<form
onSubmit={handleSubmit}
className={`p-6 rounded shadow-lg w-full max-w-sm border-2 ${theme === 'dark' ? 'bg-gray-300' : 'bg-white'}`}
className={`p-6 rounded shadow-lg w-full max-w-sm mt-[40px] mb-[20px] border-2 ${theme === 'dark' ? 'bg-gray-300' : 'bg-white'}`}
>
<h1 className="text-xl font-bold mb-4 text-black">Add Food Item</h1>

Expand All @@ -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
/>
</div>
Expand All @@ -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
/>
</div>
Expand All @@ -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"
></textarea>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/EditProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 `}
/>
</div>
<div className="mb-4">
Expand Down
14 changes: 8 additions & 6 deletions src/pages/Foodlist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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");
Expand Down Expand Up @@ -135,7 +137,7 @@ const Foodlist = () => {
useEffect(() => {
fetchData("breakfast", setBreakfast);
fetchData("lunch", setLunch);
fetchData("dinner", setDinner);
fetchData("dinner", setLunch);
}, [_id]);

const handleDishClick = async (dishId) => {
Expand Down Expand Up @@ -186,7 +188,7 @@ const Foodlist = () => {
};

return (
<div className="text-purple-800 min-h-screen pt-5 bg-transparent">
<div className={` text-purple-800 min-h-screen pt-5 ${theme=="dark"?"bg-[#131b33]":""}` }>
<Navbar />
<div className="container px-8 mx-auto p-4 mt-20 min-h-screen bg-transparent">
<div className="flex justify-center space-x-4 mb-8">
Expand Down Expand Up @@ -363,7 +365,7 @@ const Foodlist = () => {
{editModal && (
<Modalupdate
dish={currentDish}
onClose={() => setEditModal(false)}
onCancel={handleClose}
onUpdate={handleUpdateDish}
/>
)}
Expand Down
10 changes: 6 additions & 4 deletions src/pages/Rateus.jsx
Original file line number Diff line number Diff line change
@@ -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);
Expand All @@ -32,12 +34,12 @@ const RateUs = () => {
}}
>
<Navbar />
<div className="flex items-center justify-center flex-grow">
<div className={` flex items-center justify-center flex-grow`}>
<div
className="w-full max-w-xl mx-4 p-8 bg-white bg-opacity-90 rounded-lg shadow-lg transition-transform transform hover:scale-105 hover:shadow-2xl"
className={`w-full ${theme=='dark'?"bg-[#172554]":""} max-w-xl mx-4 p-8 bg-white bg-opacity-90 rounded-lg shadow-lg transition-transform transform hover:scale-105 hover:shadow-2xl`}
style={{ marginBottom: '100px', marginTop: '150px', textAlign: 'center' }}
>
<h1 className="text-3xl font-bold mb-6 text-black">Rate Our Website</h1>
<h1 className={`text-3xl font-bold mb-6 text-black ${theme=='dark'?"text-white":""}`}>Rate Our Website</h1>
<div className="mb-6">
{['😢', '😡', '😐', '😊', '🤩'].map((emoji) => (
<span
Expand Down
Loading