From b52e5905edbdb09814e8a6f36df31ba7061c45cf Mon Sep 17 00:00:00 2001 From: Dang Nguyen Nguyen <93059380+NwinNwin@users.noreply.github.com> Date: Mon, 20 May 2024 17:30:12 -0700 Subject: [PATCH] fixed returned item in filter doesn't work --- packages/web/src/components/Filter/Filter.jsx | 23 +++++++--------- packages/web/src/utils/Utils.js | 26 ++++++++++--------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/packages/web/src/components/Filter/Filter.jsx b/packages/web/src/components/Filter/Filter.jsx index 59863d5..1bac612 100644 --- a/packages/web/src/components/Filter/Filter.jsx +++ b/packages/web/src/components/Filter/Filter.jsx @@ -40,30 +40,31 @@ export default function Filter({ findFilter, setFindFilter, onClose, isOpen }) { setFindFilter((prev) => ({ ...prev, isFound: !prev.isFound, - })) - }, []) + })); + }, []); const handleIsShowReturned = useCallback(() => { + console.log("isShowReturned"); setFindFilter((prev) => ({ ...prev, isShowReturned: !prev.isShowReturned, })); - }, []) + }, []); const handleIsYourPosts = useCallback(() => { setFindFilter((prev) => ({ ...prev, isYourPosts: !prev.isYourPosts, })); - }, []) + }, []); const handleUploadDate = useCallback((e) => { setFindFilter((prev) => ({ ...prev, uploadDate: e.target.value, })); - }) - + }); + const handleCancel = useCallback(() => { setFindFilter({ type: "everything", @@ -74,8 +75,8 @@ export default function Filter({ findFilter, setFindFilter, onClose, isOpen }) { isShowReturned: true, }); onClose(); - }, []) - + }, []); + return ( <> @@ -189,11 +190,7 @@ export default function Filter({ findFilter, setFindFilter, onClose, isOpen }) { -