From 6b8f7e9d0c8c9bda5f0337e7cdbd7d1c6494b747 Mon Sep 17 00:00:00 2001 From: Hossein Rahmani Date: Sat, 27 Jan 2024 12:05:53 +0330 Subject: [PATCH] Bugs Fixed + Codes Cleaned --- app/components/Landing.tsx | 4 +- components/AboutUs.tsx | 3 +- components/BoxDashboard.tsx | 16 ----- components/CallUs.tsx | 23 ------ components/ComplainsDetails.tsx | 5 -- components/Counter.tsx | 58 --------------- components/FollowResult.tsx | 123 -------------------------------- components/Footer.tsx | 7 +- components/Navbar.tsx | 6 +- components/News.tsx | 2 +- components/NewsDetail.tsx | 10 +-- components/SubmitRequest.tsx | 4 +- constants/index.tsx | 19 +++-- 13 files changed, 31 insertions(+), 249 deletions(-) delete mode 100644 components/BoxDashboard.tsx diff --git a/app/components/Landing.tsx b/app/components/Landing.tsx index e15d680..eef1b7c 100644 --- a/app/components/Landing.tsx +++ b/app/components/Landing.tsx @@ -59,8 +59,6 @@ export default function Landing() { queryFn: () => getNews(), refetchOnWindowFocus: false, }); - - return (
@@ -132,7 +130,7 @@ export default function Landing() {
-
+
{boxItems.map((item, index) => { return ( diff --git a/components/AboutUs.tsx b/components/AboutUs.tsx index 6f81b10..0ff29d2 100644 --- a/components/AboutUs.tsx +++ b/components/AboutUs.tsx @@ -18,11 +18,10 @@ export default function AboutUs() { refetch(); }, [title, refetch]); - const fetchedContent = data?.content || ""; // Assuming your API response has a 'content' property return ( -
+
-

- تعداد درخواست ها 30 روز گذشته -

-
- ); -} diff --git a/components/CallUs.tsx b/components/CallUs.tsx index 1d6d867..1b096b4 100644 --- a/components/CallUs.tsx +++ b/components/CallUs.tsx @@ -14,29 +14,6 @@ import { useQuery } from "@tanstack/react-query"; export default function CallUs(props: any) { const { position, zoom } = props; - // const [title, setTitle] = useState("CullUs"); - - - // const { data, isLoading, isError, refetch } = useQuery({ - // queryKey: ["WebContents", title], - // queryFn: () => getSingleWebContents(title), - // refetchOnWindowFocus: false, - // }); - // console.log(data); - - - // useEffect(() => { - // refetch(); - // }, [title, refetch]); - - // if (isLoading) { - // return

Loading...

; - // } - // if (isError) { - // return

Error fetching content.

; - // } - - // const fetchedContent = data?.content || ""; // Assuming your API response has a 'content' property return (
diff --git a/components/ComplainsDetails.tsx b/components/ComplainsDetails.tsx index c867efd..5905b1d 100644 --- a/components/ComplainsDetails.tsx +++ b/components/ComplainsDetails.tsx @@ -135,11 +135,6 @@ export default function ComplainsDetails({ setOpen(false); } }, []); - useEffect(() => { - // if (storeData && role == "Inspector") { - // getComplaintMutation.mutate(storeData); - // } - }, [storeData]); if (getComplaintMutation.isSuccess && !Data) { data = getComplaintMutation.data; diff --git a/components/Counter.tsx b/components/Counter.tsx index 9263b12..f027834 100644 --- a/components/Counter.tsx +++ b/components/Counter.tsx @@ -1,14 +1,5 @@ import React from 'react' import { counterItems } from '@/constants' -// import patern from "../public/img/paternSvg.png" - -// Import Swiper React components -import { Swiper, SwiperSlide } from 'swiper/react'; -// Import Swiper styles -import 'swiper/css'; -import 'swiper/css/pagination'; -// import required modules -import { Pagination } from 'swiper/modules'; export default function Counter() { return ( @@ -28,56 +19,7 @@ export default function Counter() {
); })} -{/* - - {counterItems.map((item) => { - return ( - -

{item.count}

-

{item.name}

-
- ); - })} - - {/* Slide 1 */} - - {/*
*/} - -
- -
) diff --git a/components/FollowResult.tsx b/components/FollowResult.tsx index 181d323..53eec63 100644 --- a/components/FollowResult.tsx +++ b/components/FollowResult.tsx @@ -4,19 +4,7 @@ import Image from "next/image"; import Resultimg from "../public/img/followResult.png"; import Link from "next/link"; import { useRouter } from "next/navigation"; -import { ThreeDots } from "react-loader-spinner"; -import { - AlertDialog, - AlertDialogAction, - AlertDialogCancel, - AlertDialogContent, - AlertDialogDescription, - AlertDialogFooter, - AlertDialogHeader, - AlertDialogTitle, - AlertDialogTrigger, -} from "@/components/ui/alert-dialog"; import { Button } from "@/components/ui/button"; import { IoMdClose } from "react-icons/io"; import { postComplaintTracking } from "@/utils/citizenApi"; @@ -73,20 +61,8 @@ export default function FollowResult() { }, }); - function onSubmit() { - console.log("SuccessPrinttttttttttt"); - - // complaintPrintMutation.mutate({ - // Data: { trackingNumber: trackingNumber, password: password }, - // }); - } - // const possibleOperations = complaintPrintMutation.data?.possibleOperations; - // const selectOptions = Operations.filter((item, index) => - // possibleOperations.includes(index) - // ); const printableContent = "This is the content to be printed."; - console.log(complaintPrintMutation?.data); return ( <>
@@ -101,98 +77,6 @@ export default function FollowResult() {

بازگشت

- {/*
- - - - - - - - -

- گزارش شکایات -

- - - - -
- - - {complaintPrintMutation.isPending ? ( -
- -
- ) : ( -
-

- {" "} - موضوع شکایت:{" "} - - {`${complaintData?.title}`} - -

-

- {" "} - متن شکایت:{" "} - - {`${complaintData?.contents[0]?.text}`} - -

-
- -

- {" "} - جزئیات شکایت: -

-
-

- درخواست شما با کد رهگیری - {`${trackingNumber}`} - و رمز عبور - {`${password}`} - در دست بررسی و اقدام می باشد. در صورت تمایل می - توانید با شماره تلفن 0353286545 جهت پشتیبانی تماس - حاصل کنید. -

-
- )} -
-
- - - -
-
-
*/} */} - {/*
*/}
); diff --git a/components/Footer.tsx b/components/Footer.tsx index aa232ab..8bf76c8 100644 --- a/components/Footer.tsx +++ b/components/Footer.tsx @@ -20,7 +20,7 @@ export default function Footer() { //