-
+
درباره سامانه عیون
- {aboutFooterItems.map((item) => {
- return (
-
- );
- })}
+
-
+ {/*
دسترسی سریع
@@ -45,7 +50,7 @@ export default function Footer() {
);
})}
-
+
*/}
{/*
@@ -70,7 +75,6 @@ export default function Footer() {
/>
*/}
-
diff --git a/components/InspectorOperations.tsx b/components/InspectorOperations.tsx
index 73d1a2e..8ee4ac3 100644
--- a/components/InspectorOperations.tsx
+++ b/components/InspectorOperations.tsx
@@ -99,11 +99,7 @@ export default function InspectorOperations({
formData.append("text", data.text);
formData.append("trackingNumber", complaintData.trackingNumber);
formData.append("Operation", data.operation);
- if (role == "Inspector") {
- formData.append("EncodedKey", password);
- } else {
- formData.append("password", localStorage.getItem("password2") as string);
- }
+ formData.append("password", localStorage.getItem("password2") as string);
if (data?.media && data?.media?.length > 0) {
for (let i = 0; i < data.media.length; i++) {
formData.append("Medias", data.media[i]);
diff --git a/components/News.tsx b/components/News.tsx
index cd1ba88..c514311 100644
--- a/components/News.tsx
+++ b/components/News.tsx
@@ -5,146 +5,83 @@ import { getNews } from "@/utils/commonApi";
import { useQuery } from "@tanstack/react-query";
import Image from "next/image";
import Link from "next/link";
+import { convertFullTime } from "@/lib/utils";
+interface News {
+ id: string;
+ image: {
+ id: string;
+ url: string;
+ url2: string;
+ url3: string;
+ url4: string;
+ alternateText: string;
+ title: string;
+ mediaType: 0;
+ };
+ title: string;
+ description: string;
+ dateTime: string;
+ url: string;
+ content: string;
+ isDeleted: boolean;
+}
export default function News() {
const { data, isLoading, isError, refetch } = useQuery({
queryKey: ["News"],
queryFn: () => getNews(),
- refetchOnWindowFocus: false,
});
console.log(data);
- if (isLoading) {
- return
Loading...
;
- }
- if (isError) {
- return
Error fetching content.
;
- }
-
return (
-
-
-
+
+
اخبار
+
{/* {data.map((item: any, index: number) => {
return
News
;
})} */}
-
-
-
-
-
-
-
-
- اخبار
-
-
- 24 آذر ماه 1402
-
-
- شروع به کار سامانه عیون
-
-
- این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور
- مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است
- ...
-
-
- بیشتر بخوانید{" "}
-
-
-
+
+
+
-
-
-
-
-
-
-
- اخبار
-
-
- 24 آذر ماه 1402
-
-
- شروع به کار سامانه عیون
-
-
- این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور
- مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است
- ...
-
-
- بیشتر بخوانید{" "}
-
-
-
-
-
-
-
-
-
-
-
- اخبار
-
-
- 24 آذر ماه 1402
-
-
- شروع به کار سامانه عیون
-
-
- این سامانه با هدف نظارت بر عملکرد پرسنل و نهادهای مرتبط با امور
- مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است
- ...
-
-
- بیشتر بخوانید{" "}
-
-
-
+
+ {/*
+ اخبار
+
*/}
+
+
+ {convertFullTime(item.dateTime)}
+
+
+ {item.title}
+
+
+ {item?.description}
+
+
+
+ بیشتر بخوانید{" "}
+
+
+
+ );
+ })}
);
diff --git a/components/NewsDetail.tsx b/components/NewsDetail.tsx
new file mode 100644
index 0000000..78edde6
--- /dev/null
+++ b/components/NewsDetail.tsx
@@ -0,0 +1,71 @@
+"use client";
+import { convertFullTime } from "@/lib/utils";
+import { getNewsById } from "@/utils/commonApi";
+import { useQuery } from "@tanstack/react-query";
+import { ArrowRight } from "lucide-react";
+import Image from "next/image";
+import { useRouter } from "next/navigation";
+import React from "react";
+
+interface News {
+ id: string;
+ image: {
+ id: string;
+ url: string;
+ url2: string;
+ url3: string;
+ url4: string;
+ alternateText: string;
+ title: string;
+ mediaType: 0;
+ };
+ title: string;
+ description: string;
+ dateTime: string;
+ url: string;
+ content: string;
+ isDeleted: boolean;
+}
+
+export default function NewsDetail({ id }: { id: any }) {
+ const router = useRouter();
+ const { data, isLoading, isError, refetch } = useQuery({
+ queryKey: ["News", id],
+ queryFn: () => getNewsById(id),
+ });
+
+ return (
+
+ {data && (
+ <>
+
+
router.push("/News")}
+ >
+
+
+
+
بازگشت
+
+
+
{data?.title}
+
+
+
+
+ {convertFullTime(data.dateTime)}
+
+
{data.content}
+ >
+ )}
+
+ );
+}
diff --git a/components/Profile.tsx b/components/Profile.tsx
index bf54ffe..f275193 100644
--- a/components/Profile.tsx
+++ b/components/Profile.tsx
@@ -22,6 +22,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
import { editProfile, getProfile } from "@/utils/authenticateApi";
import { useRouter } from "next/navigation";
import { toast } from "sonner";
+import { Oval } from "react-loader-spinner";
const FormSchema = z.object({
firstName: z.string().min(1, {
@@ -63,8 +64,10 @@ export default function Profile() {
mutationKey: ["editProfile"],
mutationFn: editProfile,
onSuccess: (res) => {
- router.push("/RequestStep2");
- localStorage.setItem("authorized", "true");
+ refetch();
+ toast("پروفایل شما با موفقیت ویرایش شد.", {
+ className: "!bg-green-500 !text-white",
+ });
},
onError: (err: any | string) => {
toast(<>{err.response.data.detail}>, {
@@ -86,15 +89,9 @@ export default function Profile() {
}, [profileData]);
console.log(form.getValues());
+
function onSubmit(data: z.infer
) {
- // toast({
- // title: "You submitted the following values:",
- // description: (
- //
- // {JSON.stringify(data, null, 2)}
- //
- // ),
- // });
+ console.log(data);
const strNationalId = String(data.nationalId);
const payload = { ...data, nationalId: strNationalId };
console.log(data);
@@ -104,13 +101,14 @@ export default function Profile() {
return (
+
پروفایل کاربری
{profileData && (