Bugs fixed
parent
525cd00055
commit
13fafbf9a8
|
|
@ -14,16 +14,21 @@ import { useQuery } from "@tanstack/react-query";
|
||||||
|
|
||||||
export default function CallUs(props: any) {
|
export default function CallUs(props: any) {
|
||||||
const { position, zoom } = props;
|
const { position, zoom } = props;
|
||||||
|
const { data, isLoading, isError, refetch } = useQuery({
|
||||||
|
queryKey: ["WebContents", "CallUs"],
|
||||||
|
queryFn: () => getSingleWebContents("CallUs"),
|
||||||
|
refetchOnWindowFocus: false,
|
||||||
|
});
|
||||||
|
console.log(data);
|
||||||
|
const fetchedContent = data?.content || "";
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-900 w-screen">
|
<div className="bg-white dark:bg-gray-900 pt-8 3xl:w-[60%] w-[80%] ">
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
|
|
||||||
{/* <div className="w-full mt-6"> */}
|
{/* <div className="w-full mt-6"> */}
|
||||||
{/* <Map /> */}
|
{/* <Map /> */}
|
||||||
{/* </div> */}
|
{/* </div> */}
|
||||||
|
<div dangerouslySetInnerHTML={{ __html: fetchedContent }} />
|
||||||
<div className="container flex items-center h-[90vh]">
|
{/* <div className="container flex items-center h-[90vh]">
|
||||||
<div className="grid gap-8 md:gap-0 grid-cols-1 md:grid-cols-2 md:h-[40vh] h-full w-full lg:px-32 xl:px-52 md:py-8 py-12">
|
<div className="grid gap-8 md:gap-0 grid-cols-1 md:grid-cols-2 md:h-[40vh] h-full w-full lg:px-32 xl:px-52 md:py-8 py-12">
|
||||||
{callUsItems.map((item) => {
|
{callUsItems.map((item) => {
|
||||||
return (
|
return (
|
||||||
|
|
@ -59,7 +64,7 @@ export default function CallUs(props: any) {
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,8 @@ export default function ComplainsDetails({
|
||||||
mutationFn: postComplaintTracking,
|
mutationFn: postComplaintTracking,
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
|
localStorage.removeItem("trackingNumber2");
|
||||||
|
localStorage.removeItem("password2");
|
||||||
},
|
},
|
||||||
onError: (err: any | string) => {
|
onError: (err: any | string) => {
|
||||||
toast(<>{err.response.data.detail}</>, {
|
toast(<>{err.response.data.detail}</>, {
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,6 @@ export default function FollowResult() {
|
||||||
<ComplainsDetails
|
<ComplainsDetails
|
||||||
role="Citizen"
|
role="Citizen"
|
||||||
state="FollowResult"
|
state="FollowResult"
|
||||||
Data={complaintPrintMutation?.data}
|
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { Input } from "./ui/input";
|
import { Input } from "./ui/input";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { menuItems } from "@/constants";
|
import { authorizedMenuItems, menuItems } from "@/constants";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Login from "./Login";
|
import Login from "./Login";
|
||||||
import { Button } from "./ui/button";
|
import { Button } from "./ui/button";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import TopNav from "./TopNav";
|
import TopNav from "./TopNav";
|
||||||
import { isAuthorized } from "@/lib/utils";
|
import { cn, isAuthorized } from "@/lib/utils";
|
||||||
import useToken from "@/store/useToken";
|
import useToken from "@/store/useToken";
|
||||||
import { DropdownMenu } from "@radix-ui/react-dropdown-menu";
|
import { DropdownMenu } from "@radix-ui/react-dropdown-menu";
|
||||||
import ProfileDropDown from "./ProfileDropDown";
|
import ProfileDropDown from "./ProfileDropDown";
|
||||||
|
|
@ -30,7 +30,7 @@ export default function Navbar() {
|
||||||
setAuth(false);
|
setAuth(false);
|
||||||
}
|
}
|
||||||
}, [isAuth, token]);
|
}, [isAuth, token]);
|
||||||
|
console.log(pathname);
|
||||||
return (
|
return (
|
||||||
<div className={` left-0 right-0 top-0 z-20 fixed`}>
|
<div className={` left-0 right-0 top-0 z-20 fixed`}>
|
||||||
{/* <TopNav /> */}
|
{/* <TopNav /> */}
|
||||||
|
|
@ -53,36 +53,73 @@ export default function Navbar() {
|
||||||
className="fixed z-[100] left-0 shadow-4xl right-0 top-[4rem] p-5 bg-white border-b-2 shadow-md"
|
className="fixed z-[100] left-0 shadow-4xl right-0 top-[4rem] p-5 bg-white border-b-2 shadow-md"
|
||||||
>
|
>
|
||||||
<ul className="grid gap-2 ">
|
<ul className="grid gap-2 ">
|
||||||
{menuItems.map((item, idx, array) => {
|
{auth ? (
|
||||||
// const { Icon } = item;
|
<>
|
||||||
const lastItem = array.length - 1;
|
{authorizedMenuItems.map((item, idx, array) => {
|
||||||
return (
|
// const { Icon } = item;
|
||||||
<motion.li
|
const lastItem = array.length - 1;
|
||||||
initial={{ scale: 0, opacity: 0 }}
|
return (
|
||||||
animate={{ scale: 1, opacity: 1 }}
|
<motion.li
|
||||||
transition={{
|
initial={{ scale: 0, opacity: 0 }}
|
||||||
type: "spring",
|
animate={{ scale: 1, opacity: 1 }}
|
||||||
stiffness: 260,
|
transition={{
|
||||||
damping: 20,
|
type: "spring",
|
||||||
delay: 0.1 + idx / 10,
|
stiffness: 260,
|
||||||
}}
|
damping: 20,
|
||||||
key={item.name}
|
delay: 0.1 + idx / 10,
|
||||||
className=" w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-white to-neutral-700"
|
}}
|
||||||
>
|
key={item.name}
|
||||||
<Link
|
className=" w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-white to-neutral-700"
|
||||||
onClick={() => setOpen((prev) => !prev)}
|
>
|
||||||
className={`flex items-center justify-between w-full p-3 rounded-xl text-white
|
<Link
|
||||||
|
onClick={() => setOpen((prev) => !prev)}
|
||||||
|
className={`flex items-center justify-between w-full p-3 rounded-xl text-white
|
||||||
${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
|
${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
|
||||||
href={item.href}
|
href={item.href}
|
||||||
>
|
>
|
||||||
<span className="flex gap-1 text-sm">
|
<span className="flex gap-1 text-sm">
|
||||||
{item.name}
|
{item.name}
|
||||||
</span>
|
</span>
|
||||||
{/* <Icon className="text-xl" /> */}
|
{/* <Icon className="text-xl" /> */}
|
||||||
</Link>
|
</Link>
|
||||||
</motion.li>
|
</motion.li>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{menuItems.map((item, idx, array) => {
|
||||||
|
// const { Icon } = item;
|
||||||
|
const lastItem = array.length - 1;
|
||||||
|
return (
|
||||||
|
<motion.li
|
||||||
|
initial={{ scale: 0, opacity: 0 }}
|
||||||
|
animate={{ scale: 1, opacity: 1 }}
|
||||||
|
transition={{
|
||||||
|
type: "spring",
|
||||||
|
stiffness: 260,
|
||||||
|
damping: 20,
|
||||||
|
delay: 0.1 + idx / 10,
|
||||||
|
}}
|
||||||
|
key={item.name}
|
||||||
|
className=" w-full p-[0.08rem] rounded-xl bg-gradient-to-tr from-neutral-800 via-white to-neutral-700"
|
||||||
|
>
|
||||||
|
<Link
|
||||||
|
onClick={() => setOpen((prev) => !prev)}
|
||||||
|
className={`flex items-center justify-between w-full p-3 rounded-xl text-white
|
||||||
|
${lastItem === idx ? "bg-yellow" : "bg-blue"} `}
|
||||||
|
href={item.href}
|
||||||
|
>
|
||||||
|
<span className="flex gap-1 text-sm">
|
||||||
|
{item.name}
|
||||||
|
</span>
|
||||||
|
{/* <Icon className="text-xl" /> */}
|
||||||
|
</Link>
|
||||||
|
</motion.li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -107,17 +144,45 @@ export default function Navbar() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className=" flex gap-5 items-center mr-8 max-md:hidden">
|
<div className=" flex gap-5 items-center mr-8 max-md:hidden">
|
||||||
{menuItems.map((item, index, array) => {
|
{auth ? (
|
||||||
if (array.length - 1 !== index) {
|
<>
|
||||||
return (
|
{authorizedMenuItems.map((item, index, array) => {
|
||||||
<Link key={item.id} href={item.href}>
|
return (
|
||||||
<div className=" text-sm font-bold">{item.name}</div>
|
<Link
|
||||||
</Link>
|
className={cn(
|
||||||
);
|
" p-2 rounded-md",
|
||||||
} else {
|
pathname == item.href && "bg-gray-200"
|
||||||
return <></>;
|
)}
|
||||||
}
|
key={item.id}
|
||||||
})}
|
href={item.href}
|
||||||
|
>
|
||||||
|
<div className=" text-sm font-bold">{item.name}</div>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
{menuItems.map((item, index, array) => {
|
||||||
|
if (array.length - 1 !== index) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
className={cn(
|
||||||
|
" p-1 rounded-md",
|
||||||
|
pathname == item.href && "bg-gray-200"
|
||||||
|
)}
|
||||||
|
key={item.id}
|
||||||
|
href={item.href}
|
||||||
|
>
|
||||||
|
<div className=" text-sm font-bold p-2">
|
||||||
|
{item.name}
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{auth ? (
|
{auth ? (
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { useQuery } from "@tanstack/react-query";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { convertFullTime } from "@/lib/utils";
|
import { convertFullTime } from "@/lib/utils";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
interface News {
|
interface News {
|
||||||
id: string;
|
id: string;
|
||||||
image: {
|
image: {
|
||||||
|
|
@ -27,12 +28,12 @@ interface News {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function News() {
|
export default function News() {
|
||||||
|
const router = useRouter();
|
||||||
const { data, isLoading, isError, refetch } = useQuery({
|
const { data, isLoading, isError, refetch } = useQuery({
|
||||||
queryKey: ["News"],
|
queryKey: ["News"],
|
||||||
queryFn: () => getNews(),
|
queryFn: () => getNews(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white dark:bg-gray-900 pt-8 3xl:w-[60%] w-[80%] ">
|
<div className="bg-white dark:bg-gray-900 pt-8 3xl:w-[60%] w-[80%] ">
|
||||||
<h2 className=" w-full font-bold mb-2">اخبار</h2>
|
<h2 className=" w-full font-bold mb-2">اخبار</h2>
|
||||||
|
|
@ -44,8 +45,9 @@ export default function News() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
onClick={() => router.push(`/News/${item.id}`)}
|
||||||
className="w-full lg:w-[48%] border rounded-lg flex flex-row shadow-md hover:shadow-none transition-all
|
className="w-full lg:w-[48%] border rounded-lg flex flex-row shadow-md hover:shadow-none transition-all
|
||||||
h-[20em] sm:h-[15em] max-sm:flex-col max-sm:gap-[3px]"
|
h-[20em] sm:h-[15em] max-sm:flex-col max-sm:gap-[3px] cursor-pointer"
|
||||||
>
|
>
|
||||||
<div className="w-1/2 h-full rounded-r-lg max-sm:h-1/2 max-md:w-1/3 max-sm:w-full">
|
<div className="w-1/2 h-full rounded-r-lg max-sm:h-1/2 max-md:w-1/3 max-sm:w-full">
|
||||||
<Image
|
<Image
|
||||||
|
|
|
||||||
|
|
@ -70,12 +70,18 @@ export default function ProfileDropDown() {
|
||||||
const saveToken = useToken((state) => state.saveToken);
|
const saveToken = useToken((state) => state.saveToken);
|
||||||
return (
|
return (
|
||||||
<DropdownMenu dir="rtl">
|
<DropdownMenu dir="rtl">
|
||||||
<DropdownMenuTrigger className=" max-sm:-mr-8 max-sm:text-xs" asChild>
|
<DropdownMenuTrigger
|
||||||
<Button variant="outline">
|
className=" max-sm:-mr-8 max-sm:text-xs w-12"
|
||||||
|
asChild
|
||||||
|
>
|
||||||
|
<Button variant="outline" className=" truncate w-32 grid place-content-center">
|
||||||
{/* {profileData?.title ? profileData?.title : profileData?.userName} */}
|
{/* {profileData?.title ? profileData?.title : profileData?.userName} */}
|
||||||
{profileData?.firstName || profileData?.lastName
|
<p className=" truncate w-full">
|
||||||
? profileData?.firstName + " " + profileData?.lastName
|
{" "}
|
||||||
: profileData?.userName}
|
{profileData?.firstName || profileData?.lastName
|
||||||
|
? profileData?.firstName + " " + profileData?.lastName
|
||||||
|
: profileData?.userName}
|
||||||
|
</p>
|
||||||
</Button>
|
</Button>
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
<DropdownMenuContent className="w-56 sm:ml-10">
|
<DropdownMenuContent className="w-56 sm:ml-10">
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import {
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { ControllerTableItems } from "@/constants";
|
import { ControllerTableItems } from "@/constants";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Decrypt, convertDate } from "@/lib/utils";
|
import { Decrypt, convertDate, convertFullTime } from "@/lib/utils";
|
||||||
import useData from "@/store/useData";
|
import useData from "@/store/useData";
|
||||||
import { Label } from "./ui/label";
|
import { Label } from "./ui/label";
|
||||||
import { Input } from "./ui/input";
|
import { Input } from "./ui/input";
|
||||||
|
|
@ -76,8 +76,9 @@ export default function TableController({ data }: { data: Complaint[] }) {
|
||||||
<TableHeader>
|
<TableHeader>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableHead>ردیف</TableHead>
|
<TableHead>ردیف</TableHead>
|
||||||
<TableHead>تاریخ</TableHead>
|
|
||||||
<TableHead>کد پیگیری</TableHead>
|
<TableHead>کد پیگیری</TableHead>
|
||||||
|
<TableHead>تاریخ ثبت</TableHead>
|
||||||
|
<TableHead>تاریخ آخرین تغییر</TableHead>
|
||||||
<TableHead>موضوع</TableHead>
|
<TableHead>موضوع</TableHead>
|
||||||
<TableHead>وضعیت</TableHead>
|
<TableHead>وضعیت</TableHead>
|
||||||
<TableHead>دستگاه مربوطه</TableHead>
|
<TableHead>دستگاه مربوطه</TableHead>
|
||||||
|
|
@ -104,19 +105,22 @@ export default function TableController({ data }: { data: Complaint[] }) {
|
||||||
<TableCell className="w-1/12 font-medium ">
|
<TableCell className="w-1/12 font-medium ">
|
||||||
{index + 1}
|
{index + 1}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
<TableCell className="w-1/12">{item.trackingNumber}</TableCell>
|
||||||
<TableCell className="w-2/12">
|
<TableCell className="w-2/12">
|
||||||
{convertDate(item.registeredAt)}
|
{convertFullTime(item.registeredAt)}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="w-2/12">{item.trackingNumber}</TableCell>
|
|
||||||
<TableCell className="w-2/12">
|
<TableCell className="w-2/12">
|
||||||
|
{convertFullTime(item.lastChanged)}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell className="w-1/12">
|
||||||
{item?.title ? item.title : "-"}
|
{item?.title ? item.title : "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="w-2/12">
|
<TableCell className="w-3/12">
|
||||||
{item?.statusWithDescription
|
{item?.statusWithDescription
|
||||||
? item.statusWithDescription.description
|
? item.statusWithDescription.description
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className="w-3/12">
|
<TableCell className="w-4/12">
|
||||||
{item?.complaintOrganization
|
{item?.complaintOrganization
|
||||||
? item?.complaintOrganization.title
|
? item?.complaintOrganization.title
|
||||||
: "-"}
|
: "-"}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,20 @@ import bgimg from "../public/img/bg.png";
|
||||||
|
|
||||||
export const menuItems = [
|
export const menuItems = [
|
||||||
{ id: 1, name: "صفحه اصلی", href: "/" },
|
{ id: 1, name: "صفحه اصلی", href: "/" },
|
||||||
{ id: 2, name: "اخبار", href: "/News" },
|
{ id: 2, name: "پیگیری", href: "/FollowUp" },
|
||||||
{ id: 3, name: "تماس با ما", href: "/CallUs" },
|
{ id: 3, name: "اخبار", href: "/News" },
|
||||||
{ id: 4, name: "پیگیری", href: "/FollowUp" },
|
{ id: 4, name: "تماس با ما", href: "/CallUs" },
|
||||||
{ id: 5, name: "ورود به پنل کاربری", href: "/Login" },
|
{ id: 5, name: "ورود به پنل کاربری", href: "/Login" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const authorizedMenuItems = [
|
||||||
|
{ id: 1, name: "صفحه اصلی", href: "/" },
|
||||||
|
{ id: 2, name: "پیگیری", href: "/FollowUp" },
|
||||||
|
{ id: 3, name: "درخواست های من", href: "/Account/Complaints" },
|
||||||
|
{ id: 4, name: "اخبار", href: "/News" },
|
||||||
|
{ id: 5, name: "تماس با ما", href: "/CallUs" },
|
||||||
|
];
|
||||||
|
|
||||||
export const sliderItems = [
|
export const sliderItems = [
|
||||||
{ id: 1, img: bgimg },
|
{ id: 1, img: bgimg },
|
||||||
{ id: 2, img: bgimg },
|
{ id: 2, img: bgimg },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue