From cc0f76b9ebcb9a941f78d2229ad181f9f842073c Mon Sep 17 00:00:00 2001 From: Dang Nguyen Nguyen Date: Fri, 22 Sep 2023 00:09:29 -0700 Subject: [PATCH] fixed backend variables inconsistency --- src/assets/logos/resolved.png | Bin 0 -> 6193 bytes src/components/CreateModal/CreateModal.jsx | 24 ++-- .../FeedbackModal/FeedbackModal.jsx | 6 +- src/components/Home/Home.jsx | 106 +++++++++--------- src/components/Map/Map.jsx | 29 +++-- src/components/Map/MapIcons.js | 11 ++ src/components/ResultCard/ResultCard.jsx | 28 ++++- src/components/ResultsBar/ResultsBar.jsx | 3 +- 8 files changed, 126 insertions(+), 81 deletions(-) create mode 100644 src/assets/logos/resolved.png diff --git a/src/assets/logos/resolved.png b/src/assets/logos/resolved.png new file mode 100644 index 0000000000000000000000000000000000000000..f6a2825521420b5dddc58327f3f426d85fa9f937 GIT binary patch literal 6193 zcmV-17|!R3P)Py1>q$gGRCr$HT?<%LW#0b-GF%3XghoJfW%rTH&pxFuZM7^fd2P4W3Nb)XGTm&o zTGtzD3g#tscXiQfO#vCug=&@0HH$CF+Agj=gqjw+)#7g6K+r(tGQiCD{NHo_<2&!1 zGjrwwjO}@zY1Gb~%m4TO@0ZsPy8iH!Z;9XZ@dp6>1PI^!ztK7T@A;><$bT^d0DkcA z_}#&M)1T=aIuFmK-_v)OP=;QnD{dwdo+mmIzK09|`%X$qx-}ysz)0?ZJrKRPohK7bu%gf8(NKQ`v z0ss&Q{Itp6Ja-UBbUFx~4S!8Z0Mh!o<6%*uU->$I$a-c5?$?DCX?yx z<;$1LcJJQ3Yw6OZ)c|1P06|cQGdf)?brt|3;Yq|G(Sra$cktlB`$vr$wIDn^{NAo0 zy4pRiU%&phlP6E+jvP7iZ5asU2>KvbkS^&IvD6s=@QRfuybcL};J|?gCQO*H(bLs# zZv7rw>y9(J_6Y9}fj#?sgd=iAMMcFL8HiQ@zz>Nj0)ki89^H?A>}>#e;*+RB!Uq); z6byarvBzH2>-Cyfd|TrgX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A{{xmf%p!y@^0@MT2W^7UhOU>?IyLRoU6)RSJCCqJeePF0os=9EVuK+;$ z$SD_Km;%e<_Z-!;coA(o3-~5MEQ`+(%i=p)zlZ9)I52)3!bDK&$Y%ISMz!6@ zNY3&>;yWx8cawe||I8Nwpg({TpKQl9v%EVFpsBWa-F(uu+fUg0d#0B9sH8oq6nnREi@DPWk;=j3CChjKvJpP%l z0zh1V&RJM?c6R*Al`HN10!MGZdGqFxixw^Vhr;f59uv)*7w|;@crHM*6w6*htE;OQ zi-SYd2q6#1z!Dj%)pWUF%9})XbS+;7fae0XdFX`;7qX+HqaC(LUb=KC*I+Q)AIBD@%E>kRsNe9iv{iRMxjWOQ*5 P00000NkvXXu0mjf9JHTm literal 0 HcmV?d00001 diff --git a/src/components/CreateModal/CreateModal.jsx b/src/components/CreateModal/CreateModal.jsx index 566d3c8..6fe3b4b 100644 --- a/src/components/CreateModal/CreateModal.jsx +++ b/src/components/CreateModal/CreateModal.jsx @@ -150,9 +150,9 @@ export default function CreateModal({ islost: true, name: "", description: "", - itemDate: "", - isResolved: false, - isHelped: null, + itemdate: "", + isresolved: false, + ishelped: null, }); setUploadImg(""); setActiveStep(0); @@ -173,9 +173,9 @@ export default function CreateModal({ islost: true, name: "", description: "", - itemDate: "", - isResolved: false, - isHelped: null, + itemdate: "", + isresolved: false, + ishelped: null, }); setUploadImg(""); setActiveStep(0); @@ -344,7 +344,7 @@ export default function CreateModal({ setDate(e); setNewAddedItem((prev) => ({ ...prev, - itemDate: e.toISOString().split("T")[0], + itemdate: e.toISOString().split("T")[0], })); }} value={date} @@ -515,7 +515,7 @@ export default function CreateModal({ > - {newAddedItem.itemDate} + {newAddedItem.itemdate} @@ -548,9 +548,9 @@ export default function CreateModal({ islost: true, name: "", description: "", - itemDate: "", - isResolved: false, - isHelped: null, + itemdate: "", + isresolved: false, + ishelped: null, }); setUploadImg(""); onClose(); @@ -565,7 +565,7 @@ export default function CreateModal({ (activeStep === 0 && newAddedItem.name === "") || newAddedItem.description === "" || (activeStep === 1 && newAddedItem.type === "") || - (activeStep === 2 && newAddedItem.itemDate === "") || + (activeStep === 2 && newAddedItem.itemdate === "") || (activeStep === 3 && uploadImg === "") } variant={"solid"} diff --git a/src/components/FeedbackModal/FeedbackModal.jsx b/src/components/FeedbackModal/FeedbackModal.jsx index 45feba0..cc53a1f 100644 --- a/src/components/FeedbackModal/FeedbackModal.jsx +++ b/src/components/FeedbackModal/FeedbackModal.jsx @@ -27,7 +27,9 @@ export default function FeedbackModal({ setLoading(false); axios .put(`${process.env.REACT_APP_AWS_BACKEND_URL}/items/${props.id}`, { - isHelped: feedbackHelped, + ...props, + isresolved: true, + ishelped: feedbackHelped, }) .then(() => console.log("Success")) .catch((err) => console.log(err)); @@ -37,7 +39,7 @@ export default function FeedbackModal({ return prevItems.map((item) => { if (item.id === props.id) { item.isresolved = true; - item.isHelped = feedbackHelped; + item.ishelped = feedbackHelped; } return item; }); diff --git a/src/components/Home/Home.jsx b/src/components/Home/Home.jsx index 9e39de7..278ebe9 100644 --- a/src/components/Home/Home.jsx +++ b/src/components/Home/Home.jsx @@ -84,9 +84,9 @@ export default function Home() { islost: true, name: "", description: "", - itemDate: "", - isResolved: false, - isHelped: null + itemdate: "", + isresolved: false, + ishelped: null, }); const [isEdit, setIsEdit] = useState(false); @@ -97,7 +97,7 @@ export default function Home() { const [screenWidth, setScreenWidth] = useState(window.screen.width); const [uploadImg, setUploadImg] = useState(""); - console.log(data) + console.log(data); // LOGIN MODAL const { @@ -137,10 +137,11 @@ export default function Home() { }; getData(); }, []); - + window.onresize = () => { setScreenWidth(window.screen.width); }; + console.log(data); return ( {user ? ( - - - - - - - - logoutbutton - {user?.email} - - { - setFindFilter((prev) => ({ - ...prev, - isYourPosts: !prev.isYourPosts, - })); - onOpen(); - }} - > + <> + Leaderboard + + logoutbutton - Your Posts - + - - logoutbutton - Logout - - - + + + logoutbutton + {user?.email} + + { + setFindFilter((prev) => ({ + ...prev, + isYourPosts: !prev.isYourPosts, + })); + onOpen(); + }} + > + logoutbutton + Your Posts + + + + logoutbutton + Logout + + + + ) : (