From 5c8d1e72ddfa69be671299aa367e173c2ea4f3dc Mon Sep 17 00:00:00 2001 From: Ebube Date: Tue, 4 Jul 2023 10:38:35 +0100 Subject: [PATCH] . --- src/components/FamilyPopup/SuggestTask.jsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/FamilyPopup/SuggestTask.jsx b/src/components/FamilyPopup/SuggestTask.jsx index 4d2ffa9..b1e4b5f 100644 --- a/src/components/FamilyPopup/SuggestTask.jsx +++ b/src/components/FamilyPopup/SuggestTask.jsx @@ -18,7 +18,7 @@ const SuggestTask = ({ details, onClose, situation }) => { description: details?.description || "", }; - const apiCall = useMemo(() => new usersService(), []); + const apiCall = new usersService(); const handleSubmit = async (values) => { try { @@ -34,7 +34,7 @@ const SuggestTask = ({ details, onClose, situation }) => { onClose(); }, 2000); } catch (error) { - setSubmitTask({ loading: false, msg: error, state: "bad" }); + setSubmitTask({ loading: false, msg: error, state: "bad" }); throw new Error("Error Occurred", error); } }; @@ -153,7 +153,13 @@ const SuggestTask = ({ details, onClose, situation }) => { className="text-white primary-gradient text-18 tracking-wide px-4 py-3 rounded-full" // className='w-20 h-11 flex justify-center items-center btn-gradient text-base rounded-full text-white' > - Send to Parents + {submitTask.loading + ? "Submitting Task" + : submitTask.state == "success" + ? "Task Submitted" + : submitTask.state == "bad" + ? "Error occurred" + : "Send to Parents"} {/* )} */}