From 8e00f200a7bc6dc9821d72198e3fe79dc8cd6804 Mon Sep 17 00:00:00 2001 From: Hossein Rahmani Date: Sat, 27 Jan 2024 13:21:14 +0330 Subject: [PATCH] Bugs fixed --- components/FollowUp.tsx | 35 +++++++++++++++++------------------ components/Verify.tsx | 4 ++-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/components/FollowUp.tsx b/components/FollowUp.tsx index f16be80..145fb49 100644 --- a/components/FollowUp.tsx +++ b/components/FollowUp.tsx @@ -25,6 +25,7 @@ import Link from "next/link"; import FollowResult from "./FollowResult"; import { postComplaintTracking } from "@/utils/citizenApi"; import { toast } from "sonner"; +import { Oval } from "react-loader-spinner"; const FormSchema = z.object({ trackingNumber: z.string().min(2, { @@ -52,22 +53,6 @@ export default function FollowUp() { // router.push("/FollowResult"); router.push("/FollowResult", { data: JSON.stringify(result) }); - - // router.push( - // "/FollowResult", - // { - // data: JSON.stringify(result), - // }, - // ); - - // router.push({ - // pathname : '/FollowResult', - // query : { - // data: JSON.stringify( result ) ; - // }, - // }); - - // return (res) }, onError: (err: any | string) => { toast(<>{err.response.data.detail}, { @@ -95,7 +80,7 @@ export default function FollowUp() { // }); console.log(data); - + localStorage.setItem("trackingNumber2", data.trackingNumber); localStorage.setItem("password2", data.password); @@ -162,7 +147,21 @@ export default function FollowUp() { type="submit" className="w-1/2 p-2 text-center text-white bg-blue min-w-max sm:w-1/3 lg:w-1/4 rounded-xl" > - پیگیری درخواست + {complaintTrackingMutation.isPending ? ( +
+ +
+ ) : ( + "پیگیری درخواست" + )} diff --git a/components/Verify.tsx b/components/Verify.tsx index 0e74a50..321b968 100644 --- a/components/Verify.tsx +++ b/components/Verify.tsx @@ -81,8 +81,8 @@ export default function Verify() {