From 4d761a9b938eb7791523e47d799b2dc1d3e276cb Mon Sep 17 00:00:00 2001 From: Mahmoud khairy Date: Sat, 6 Jul 2024 06:27:44 +0300 Subject: [PATCH 1/4] recomendation is working ..! link with contact link with delete profile --- .../FoodIngreientSlider.jsx | 49 +++------ .../components/mealsSlider/mealsSlider.jsx | 9 +- wannameal/src/pages/contact/contact.jsx | 101 +++++++++++++----- .../src/pages/profile/edit/editProfile.jsx | 77 ++++++++----- .../src/redux/slices/recomendedMealsSlice.jsx | 5 +- 5 files changed, 147 insertions(+), 94 deletions(-) diff --git a/wannameal/src/components/FoodIngreientSlider/FoodIngreientSlider.jsx b/wannameal/src/components/FoodIngreientSlider/FoodIngreientSlider.jsx index 817d5c3..1665e72 100644 --- a/wannameal/src/components/FoodIngreientSlider/FoodIngreientSlider.jsx +++ b/wannameal/src/components/FoodIngreientSlider/FoodIngreientSlider.jsx @@ -44,8 +44,6 @@ function FoodIngreientSlider() { const ingredientsStatus = useSelector(getIngredientsStatus); const ingredientError = useSelector(getIngredientsError); const language = useSelector(getLanguage); - console.log("🚀 ~ FoodIngreientSlider ~ language:", language); - console.log("🚀 ~ FoodIngreientSlider ~ language:", language); const handleCheckboxChange = (ingredient) => { setCheckedIngredients((prevIngredients) => { @@ -89,7 +87,7 @@ function FoodIngreientSlider() { useEffect(() => { const fetchMeals = async () => { try { - let ingredientNames = "موز"; // Default value if no checked ingredients + let ingredientNames = ""; // Default value if no checked ingredients console.log("🚀 ~ fetchMeals ~ ingredientNames:", ingredientNames); if (checkedIngredients.length > 0) { ingredientNames = checkedIngredients @@ -101,37 +99,19 @@ function FoodIngreientSlider() { "🚀 ~ fetchMeals ~ checkedIngredients:", checkedIngredients ); - console.log( - "🚀🚀🚀🚀🚀 ~ fetchMeals ~ ingredientNames:", - ingredientNames - ); - - await dispatch( - recommendMeals({ - ingredients: ingredientNames, - lang: language, - token: availableUser?.token, - }) - ); - - // axios - // .get("https://tesst11.azurewebsites.net/meals/recommendMeal", { - // params: { - // lang: language, - // ingredients: ingredientNames, - // }, - // headers: { - // token: availableUser?.token, - // }, - // }) - // .then((response) => { - // console.log(response.data); - // }) - // .catch((error) => { - // console.error(error); - // }); - - // console.log("Recommendation response:", response); // Log the response or handle it as needed + console.log(ingredientNames); + console.log(typeof ingredientNames); + + if (ingredientNames !== "") { + const response = await dispatch( + recommendMeals({ + ingredients: ingredientNames, + lang: language, + token: availableUser?.token, + }) + ); + console.log("Recommendation response:", response); // Log the response or handle it as needed + } } catch (error) { console.error("Error fetching meals:", error); } @@ -230,6 +210,7 @@ function FoodIngreientSlider() { slidesPerView: 8.5, }, }} + style={{ direction: "ltr" }} > {filteredIngredients.map((ingredient, index) => ( diff --git a/wannameal/src/components/mealsSlider/mealsSlider.jsx b/wannameal/src/components/mealsSlider/mealsSlider.jsx index eeeec96..79653db 100644 --- a/wannameal/src/components/mealsSlider/mealsSlider.jsx +++ b/wannameal/src/components/mealsSlider/mealsSlider.jsx @@ -24,6 +24,7 @@ import { getRecommendMeals, } from "../../redux/slices/recomendedMealsSlice"; import Loading from "../loading/loading"; +import CommonMeals from "../commonMeals/commonMeals"; function MealsSlider() { const recomendedMeals = useSelector(getRecommendMeals); @@ -33,6 +34,9 @@ function MealsSlider() { const error = useSelector(getMealsError); console.log("🚀 ~ MealsSlider ~ error:", error); + if (recomendedMeals && recomendedMeals.length == 0) { + return ; + } if (mealsStatus == "loading") return (
@@ -74,12 +78,13 @@ function MealsSlider() { spaceBetween: 40, }, }} + style={{ direction: "ltr" }} > - {/* {recomendedMeals?.map((meal, index) => ( + {recomendedMeals?.map((meal, index) => ( - ))} */} + ))}
); diff --git a/wannameal/src/pages/contact/contact.jsx b/wannameal/src/pages/contact/contact.jsx index a485d01..e2324ef 100644 --- a/wannameal/src/pages/contact/contact.jsx +++ b/wannameal/src/pages/contact/contact.jsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import styles from "./contactUS.module.css"; import { MdOutlineLocationOn } from "react-icons/md"; import { FiPhone } from "react-icons/fi"; @@ -8,9 +8,65 @@ import { FaXTwitter } from "react-icons/fa6"; import { TiSocialLinkedin } from "react-icons/ti"; import "animate.css"; import { useTranslation } from "react-i18next"; +import axios from "axios"; +import Swal from "sweetalert2"; + function ContactUs() { - const { t } = useTranslation() - const { head, fname, Email, msg, send, location, phone, mail } = t('contact') + const { t } = useTranslation(); + const { head, fname, Email, msg, send, location, phone, mail } = t("contact"); + + const [formData, setFormData] = useState({ + name: "", + email: "", + message: "", + }); + + console.log("🚀 ~ ContactUs ~ formData:", formData); + const handleChange = (e) => { + const { name, value } = e.target; + setFormData({ + ...formData, + [name]: value, + }); + }; + + const handleSubmit = async (e) => { + e.preventDefault(); + try { + const response = await axios.post( + "https://fast-plat1.vercel.app/contactus", + formData + ); + console.log("🚀 ~ handleSubmit ~ response:", response); + Swal.fire({ + icon: "success", + title: response?.data?.message, + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 3000, + timerProgressBar: true, + }); + + setFormData({ + name: "", + email: "", + message: "", + }); + } catch (error) { + console.error("Failed to send contact: ", error); + Swal.fire({ + icon: "error", + title: "Failed to send", + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }); + } + }; + return (
-
+
@@ -39,6 +98,9 @@ function ContactUs() { className={`form-control ${styles.input}`} id="exampleFormControlInput1" placeholder={Email} + value={formData.email} + onChange={handleChange} + required />
@@ -48,33 +110,14 @@ function ContactUs() { placeholder={msg} id="exampleFormControlTextarea1" rows={3} - defaultValue={""} + value={formData.message} + onChange={handleChange} + required />
- -
{send}
- {/* {message &&
{message}
} */} - {/* {!isLoading ? ( -
- send message -
- ) : ( -
-
- Loading... -
-
- )} */} +
diff --git a/wannameal/src/pages/profile/edit/editProfile.jsx b/wannameal/src/pages/profile/edit/editProfile.jsx index 24e49a6..742b859 100644 --- a/wannameal/src/pages/profile/edit/editProfile.jsx +++ b/wannameal/src/pages/profile/edit/editProfile.jsx @@ -229,7 +229,7 @@ function EditProfile() { } }; - let handleDeleteAccount = () => { + const handleDeleteAccount = async () => { Swal.fire({ title: "Are you sure?", text: "You won't be able to revert this!", @@ -241,33 +241,58 @@ function EditProfile() { }).then(async (result) => { if (result.isConfirmed) { let timerInterval; - await dispatch( - deleteAccount({ - userId: decodedToken.id, - token: availableUser.token, - }) - ); - Swal.fire({ - title: "Deleting Account!", - html: "Your Account will be Deleted in second.", - timer: 5000, - timerProgressBar: true, - didOpen: () => { - Swal.showLoading(); - const timer = Swal.getPopup().querySelector("b"); - timerInterval = setInterval(() => { - timer.textContent = `${parseInt(Swal.getTimerLeft() / 1000)}`; - }, 1000); - }, - willClose: () => { - clearInterval(timerInterval); - }, - }).then((result) => { - if (result.dismiss === Swal.DismissReason.timer) { - dispatch(logout()); + try { + await dispatch( + deleteAccount({ + userId: decodedToken.id, + token: availableUser.token, + }) + ); + + if (userError) { + Swal.fire({ + icon: "error", + title: `${userError?.msgError}`, + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }); + } else { + Swal.fire({ + title: "Deleting Account!", + html: "Your Account will be Deleted in second.", + timer: 5000, + timerProgressBar: true, + didOpen: () => { + Swal.showLoading(); + const timer = Swal.getPopup().querySelector("b"); + timerInterval = setInterval(() => { + timer.textContent = `${parseInt(Swal.getTimerLeft() / 1000)}`; + }, 1000); + }, + willClose: () => { + clearInterval(timerInterval); + }, + }).then((result) => { + if (result.dismiss === Swal.DismissReason.timer) { + dispatch(logout()); + } + }); } - }); + } catch (error) { + Swal.fire({ + icon: "error", + title: `${userError?.msgError || "Failed to delete account"}`, + toast: true, + position: "top-end", + showConfirmButton: false, + timer: 2000, + timerProgressBar: true, + }); + } } }); }; diff --git a/wannameal/src/redux/slices/recomendedMealsSlice.jsx b/wannameal/src/redux/slices/recomendedMealsSlice.jsx index 5551a03..9268a22 100644 --- a/wannameal/src/redux/slices/recomendedMealsSlice.jsx +++ b/wannameal/src/redux/slices/recomendedMealsSlice.jsx @@ -22,15 +22,14 @@ export const recommendMeals = createAsyncThunk( }); const response = await axios.get( - `https://tesst11.azurewebsites.net/meals/recommendMeal?lang=${lang}`, - { ingredients }, + `https://tesst11.azurewebsites.net/meals/recommendMeal?lang=${lang}&ingredients=${ingredients}`, { headers: { "Content-Type": "application/json", }, } ); - return response; + return response.data.Recommendation; } catch (error) { return rejectWithValue(error.message); } From bd63274f3daa9baf08b47036302e569d9aef5aa2 Mon Sep 17 00:00:00 2001 From: Mahmoud khairy Date: Sat, 6 Jul 2024 07:13:15 +0300 Subject: [PATCH 2/4] =?UTF-8?q?=D8=B4=D9=88=D9=8A=D8=A9=20=D8=AD=D9=86?= =?UTF-8?q?=D9=83=D8=B4=D9=87=20=D9=83=D8=AF=D8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../postContent/postContent.module.css | 7 +-- .../src/components/savedMeals/SavedMeals.jsx | 46 ++++++++++-------- .../savedMeals/savedMeals.module.css | 7 +-- wannameal/src/pages/community/comunity.jsx | 4 +- wannameal/src/pages/profile.rar | Bin 7172 -> 0 bytes 5 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 wannameal/src/pages/profile.rar diff --git a/wannameal/src/components/postContent/postContent.module.css b/wannameal/src/components/postContent/postContent.module.css index 98a12fa..9b203ca 100644 --- a/wannameal/src/components/postContent/postContent.module.css +++ b/wannameal/src/components/postContent/postContent.module.css @@ -16,12 +16,13 @@ object-fit: cover; } -.userInfo { +.userInfo .text { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; letter-spacing: -1px; + margin-left: 8px; } .userInfo .name { font-weight: 600; @@ -29,8 +30,8 @@ } .userInfo .email { color: var(--grayWritingColor); - font-size: 14px; - transform: scale(0.8) translate(-5px, -8px); + font-size: 12px; + /* transform: scale(0.8); */ } .postText { diff --git a/wannameal/src/components/savedMeals/SavedMeals.jsx b/wannameal/src/components/savedMeals/SavedMeals.jsx index c4d38f5..ec9ee3c 100644 --- a/wannameal/src/components/savedMeals/SavedMeals.jsx +++ b/wannameal/src/components/savedMeals/SavedMeals.jsx @@ -51,27 +51,33 @@ export default function SavedMeals() { ); return ( - <> -
- {savedMeals && savedMeals.length > 0 ? ( - savedMeals.map((meal) => { - return ; - }) - ) : ( -
-
- +
+
+
+ {savedMeals && savedMeals.length > 0 ? ( + savedMeals.map((meal) => ( +
+ +
+ )) + ) : ( +
+
+ +
+

+ There are no recipes saved yet. +

+

+ Save the recipes you like to try later and you will find them + saved here.{" "} +

-

There are no recipes saved yet.

-

- Save the recipes you like to try later and you will find them - saved here.{" "} -

-
- )} + )} +
- +
); } diff --git a/wannameal/src/components/savedMeals/savedMeals.module.css b/wannameal/src/components/savedMeals/savedMeals.module.css index 15f5041..98d4c06 100644 --- a/wannameal/src/components/savedMeals/savedMeals.module.css +++ b/wannameal/src/components/savedMeals/savedMeals.module.css @@ -1,7 +1,8 @@ .recipsContainer { display: grid; - grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); - gap: 30px; + grid-template-columns: repeat(auto-fill, minmax(370px, 1fr)); + justify-content: space-between; + gap: 10px; } .noMealscontainer { @@ -11,7 +12,7 @@ flex-direction: column; gap: 10px; align-items: center; - justify-content: center; + justify-content: space-around; } .noMealscontainer .imageContainer { diff --git a/wannameal/src/pages/community/comunity.jsx b/wannameal/src/pages/community/comunity.jsx index a801786..3741f7c 100644 --- a/wannameal/src/pages/community/comunity.jsx +++ b/wannameal/src/pages/community/comunity.jsx @@ -222,8 +222,8 @@ export default function Community() { try { dispatch( getProfileById({ - userId: decodedToken.id, - token: availableUser.token, + userId: decodedToken?.id, + token: availableUser?.token, lang: language, }) ); diff --git a/wannameal/src/pages/profile.rar b/wannameal/src/pages/profile.rar deleted file mode 100644 index d8253a86f86a2582f1bfc81b277c28c4d0aded9f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7172 zcmZ{pRZtvIqofB0x8UyX8r(g&2KT{XaCdhJ?yfiU0?T6H+7*Pgogs$?uMKpL&3rW;Gm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t0CVnpM9V?QN#Mx6;q%wp{kI4KlzB0`vi)cfCTg@8x>rao zF(Fx+*9$Kzo1!u_*rK<*_X(M88igvLutdLz!-)$mJieI#fV&DWnFJG+g!5IOI(TB6 zbr8HrzjfYEO-HA0J?BEV$vH*G)Ap=!C=}c;)Vj!#05gb`zI@Xr#i5$`W-AGduXeB7 z&{%TkN|TEmJWD_SzHQ^}5V7pB(PxytV}C8i{?|Lc_xN1Z!OwS4DG^7JfT7-RtT@EqtVu%?vbi~{*}Lmnzz zqfzP>dez`FxyFs9Rnq`vH6Tju3_V>a{i0)!{Z@y2Cd2(HO$U_IyJuAO1qXks+i z!ZUubv$0K^7EnM{zwGn-kWOqkW~TeVGf;M8V4(f|2UuC2GxjxXiS@gj?3uyimC@lA zGH%nzHiw-jr$eXO{`>9{x9?kQtJ_%9R^)xfJ|y|0e@=c1trIW@ifwu)11S{P6g@}E zu9OC^>p;!rTnx0a!r6WoaY4qJayhlzT7lx&{-ezjcA#2Opy^|!7}2ZWYgqpdyBCL) z*;qN#(I)1Gr{o-}MxaCaFLwY?0Q4XL0OfxY=RaR^|Mnz;d#I&`e;LyQs Date: Sat, 6 Jul 2024 18:32:02 +0300 Subject: [PATCH 3/4] del --- wannameal/src/components/navbar/navbar.jsx | 3 --- 1 file changed, 3 deletions(-) diff --git a/wannameal/src/components/navbar/navbar.jsx b/wannameal/src/components/navbar/navbar.jsx index c4948a2..2e29a9c 100644 --- a/wannameal/src/components/navbar/navbar.jsx +++ b/wannameal/src/components/navbar/navbar.jsx @@ -1,7 +1,4 @@ // import { jwtDecode } from "jwt-decode"; -import { curve, menuSlide, slide } from "./Animate"; -import { AnimatePresence, motion } from "framer-motion"; -import userImage from "../../assets/man-user.svg"; import Swal from "sweetalert2"; import React, { useMemo, useState } from "react"; import style from "./page.module.css"; From 1f37853a9b2092c41356a29e57618bdf4a127d27 Mon Sep 17 00:00:00 2001 From: Mahmoud khairy Date: Sat, 6 Jul 2024 18:37:07 +0300 Subject: [PATCH 4/4] fix recommendation --- wannameal/src/redux/slices/recomendedMealsSlice.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wannameal/src/redux/slices/recomendedMealsSlice.jsx b/wannameal/src/redux/slices/recomendedMealsSlice.jsx index 9268a22..48957ae 100644 --- a/wannameal/src/redux/slices/recomendedMealsSlice.jsx +++ b/wannameal/src/redux/slices/recomendedMealsSlice.jsx @@ -14,7 +14,7 @@ const initialState = { export const recommendMeals = createAsyncThunk( "meals/recommendMeals", - async ({ ingredients, lang }, { rejectWithValue }) => { + async ({ ingredients, lang, token }, { rejectWithValue }) => { try { console.log("Sending request to API with params:", { lang: lang, @@ -26,6 +26,7 @@ export const recommendMeals = createAsyncThunk( { headers: { "Content-Type": "application/json", + token: token, }, } );