Compare commits
No commits in common. "e1b62373188699ea107aed7bbbee98bec417a127" and "2449e6feda25d50c553a369f601fe5b4bce82d0c" have entirely different histories.
e1b6237318
...
2449e6feda
|
|
@ -70,7 +70,6 @@ export default function Landing() {
|
|||
delay: 2500,
|
||||
disableOnInteraction: false,
|
||||
}}
|
||||
// autoplay={ data?.length > 1 ? { delay: 2500, disableOnInteraction: false } : false }
|
||||
loop={false}
|
||||
pagination={{
|
||||
clickable: true,
|
||||
|
|
@ -95,6 +94,19 @@ export default function Landing() {
|
|||
</SwiperSlide>
|
||||
);
|
||||
})}
|
||||
{data?.length == 1 && (
|
||||
<SwiperSlide>
|
||||
<Image
|
||||
alt="bg"
|
||||
src={`${process.env.NEXT_PUBLIC_BASE_URL_APP}${data[0]?.image?.url}`}
|
||||
// width={20}
|
||||
// height={20}
|
||||
layout="fill"
|
||||
quality={100}
|
||||
className=" w-full h-full object-cover max-sm:object-[70%]"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -207,11 +207,7 @@ export default function ComplainsDetails({
|
|||
{/* Editt */}
|
||||
<div className="flex items-start w-full gap-2 mt-2 max-lg:flex-col lg:h-[80vh] mb-10">
|
||||
{/* 1 */}
|
||||
<div
|
||||
className={`flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3 ${
|
||||
possibleOperations.length == 0 && "hidden"
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh] max-lg:order-3">
|
||||
{/* ***** */}
|
||||
<div className=" bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full">
|
||||
<p className="text-[#464646] text-base font-bold mb-1">
|
||||
|
|
@ -229,11 +225,7 @@ export default function ComplainsDetails({
|
|||
</div>
|
||||
|
||||
{/* 2 */}
|
||||
<div
|
||||
className={`flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 ${
|
||||
possibleOperations.length == 0 && "lg:w-full"
|
||||
}`}
|
||||
>
|
||||
<div className="flex flex-col self-stretch w-full gap-2 rounded-lg lg:w-2/3 ">
|
||||
<div className=" bg-[#E9E9E9] rounded-md py-4 px-10 flex flex-col md:flex-row gap-2 items-center justify-center">
|
||||
{data?.user == null ? (
|
||||
<>
|
||||
|
|
@ -352,25 +344,19 @@ export default function ComplainsDetails({
|
|||
className="flex flex-col mt-4 gap-y-4 overflow-auto
|
||||
scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 "
|
||||
>
|
||||
{data.contents?.map((item: any, index: any, array: any) => {
|
||||
{data.contents?.map((item: any) => {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
className="p-4 bg-white rounded-lg shadow-md "
|
||||
>
|
||||
<div className="flex items-center gap-4 justify-between">
|
||||
<div>
|
||||
<span className=" flex items-center justify-center w-8 h-8 bg-blue-100 rounded-full -start-4 ring-2 ring-blue bg-blue2 text-black">
|
||||
{array.length - index}
|
||||
</span>
|
||||
<p className="">
|
||||
<Badge>
|
||||
{item.operationWithDescription.description}{" "}
|
||||
توسط {item.sender == 0 ? "شهروند" : "بازرس"}
|
||||
</Badge>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p className="">
|
||||
<Badge>
|
||||
{item.operationWithDescription.description} توسط{" "}
|
||||
{item.sender == 0 ? "شهروند" : "بازرس"}
|
||||
</Badge>
|
||||
</p>
|
||||
<p className="">
|
||||
<span className="text-[#7C838A] text-sm">
|
||||
{convertFullTime(item.dateTime)}
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ export default function FollowUp() {
|
|||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="password"
|
||||
placeholder="رمز عبور خود را وارد کنید"
|
||||
{...field}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
|||
import { OperateByInspector } from "@/utils/inspectorApi";
|
||||
import { toast } from "sonner";
|
||||
import { postComplaintsDetails } from "@/utils/citizenApi";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useState } from "react";
|
||||
import { DialogTrigger } from "./ui/dialog";
|
||||
import AttachmentsDialog from "./AttachmentsDialog";
|
||||
import { Eye, Upload } from "lucide-react";
|
||||
|
|
@ -52,7 +52,6 @@ export default function InspectorOperations({
|
|||
password?: string;
|
||||
}) {
|
||||
const [first, setfirst] = useState<File[]>([]);
|
||||
const [charCount, setCharCount] = useState(0);
|
||||
|
||||
// Queries
|
||||
const { data, isLoading, refetch } = useQuery({
|
||||
|
|
@ -119,19 +118,6 @@ export default function InspectorOperations({
|
|||
},
|
||||
});
|
||||
|
||||
// Add the useEffect hook to monitor changes in the description field
|
||||
useEffect(() => {
|
||||
setCharCount(form.watch("text")?.length);
|
||||
}, [form.watch("text")]);
|
||||
|
||||
function handleTextChange(event: React.ChangeEvent<HTMLTextAreaElement>) {
|
||||
const newCharCount = event.target.value.length;
|
||||
// Update charCount only when the user types or removes characters
|
||||
if (newCharCount <= data?.maxTextLength) {
|
||||
setCharCount(newCharCount);
|
||||
}
|
||||
}
|
||||
|
||||
//Functions
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
const formData = new FormData();
|
||||
|
|
@ -176,26 +162,12 @@ export default function InspectorOperations({
|
|||
name="text"
|
||||
render={({ field, fieldState: { error } }) => (
|
||||
<FormItem>
|
||||
<FormLabel className="">
|
||||
متن({charCount}/{data?.maxTextLength})
|
||||
</FormLabel>
|
||||
<FormLabel className="">متن</FormLabel>
|
||||
<FormControl>
|
||||
<Textarea
|
||||
className="resize-none bg-white lg:min-h-[20em]"
|
||||
{...field}
|
||||
readOnly={possibleOperations.length == 0}
|
||||
onChange={(e) => {
|
||||
const currentValue = e.target.value;
|
||||
if (currentValue.length <= data?.maxTextLength) {
|
||||
field.onChange(e);
|
||||
handleTextChange(e);
|
||||
} else {
|
||||
// Truncate the value to the allowed limit
|
||||
field.onChange(
|
||||
currentValue.substring(0, data?.maxTextLength)
|
||||
);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
{!error ? (
|
||||
|
|
@ -264,7 +236,7 @@ export default function InspectorOperations({
|
|||
<FormDescription className=" text-xs my-1 ">
|
||||
<span>
|
||||
حجم هر فایل حداکثر می بایست {formatSize(data?.maxFileSize)}{" "}
|
||||
باشد
|
||||
مگابایت باشد
|
||||
</span>{" "}
|
||||
و{" "}
|
||||
{`تعداد فایل های پیوست شده می بایست حداکثر ${data?.maxFileCount} تا باشد.`}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@ export default function RequestStep0() {
|
|||
{RequestItems.map((item, index) => {
|
||||
return (
|
||||
<Link
|
||||
className="group bg-white border shadow-md rounded-lg p-10 h-64 w-64 flex z-10 relative
|
||||
className="group bg-white border shadow-md rounded-lg p-10 h-64 w-64 flex items-end justify-center z-10 relative
|
||||
hover:bg-blue transition-all duration-700 ease-in-out text-center
|
||||
flex-col items-center justify-end gap-2
|
||||
hover:flex-col-reverse hover:justify-evenly hover:items-center hover:cursor-pointer
|
||||
max-lg:w-52 max-lg:h-52 max-md:w-40 max-md:h-40
|
||||
max-lg:p-8 max-md:p-5 max-sm:p-2 hover:max-lg:p-2
|
||||
|
|
@ -38,9 +37,6 @@ export default function RequestStep0() {
|
|||
<p className=" z-10 text-base text-black group-hover:text-white max-md:text-sm">
|
||||
{item.name}
|
||||
</p>
|
||||
<p className=" z-10 text-xs text-center font-medium group-hover:hidden">
|
||||
{item.description}
|
||||
</p>
|
||||
|
||||
<Image
|
||||
alt="icon"
|
||||
|
|
@ -50,7 +46,7 @@ export default function RequestStep0() {
|
|||
quality={100}
|
||||
key={index}
|
||||
className={cn(
|
||||
" w-[60%] h-[60%] absolute left-12 top-6 group-hover:hidden max-md:h-[60%] max-md:w-[60%] max-md:left-auto",
|
||||
" w-[80%] h-[80%] absolute left-8 top-6 group-hover:hidden max-md:h-[60%] max-md:w-[60%] max-md:left-auto",
|
||||
item.id == 3 && "left-2"
|
||||
)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ export default function RequestStep2() {
|
|||
const router = useRouter();
|
||||
const [file, setFile] = useState<File[]>([]);
|
||||
const [charCount, setCharCount] = useState(0);
|
||||
const [charCountPerson, setCharCountPerson] = useState(0);
|
||||
|
||||
// Queries
|
||||
const { data: optionsData, isLoading: isLoadingData } = useQuery({
|
||||
|
|
@ -82,14 +81,7 @@ export default function RequestStep2() {
|
|||
OrganizationId: z.string({
|
||||
required_error: "لطفا دستگاه مربوطه را انتخاب نمایید.",
|
||||
}),
|
||||
person: z
|
||||
.string()
|
||||
.min(1, {
|
||||
message: "لطفا نام فرد مورد نظر را بنویسید.",
|
||||
})
|
||||
.max(50, {
|
||||
message: "تعداد کاراکترها بیشتر از حد مجاز میباشد.",
|
||||
}),
|
||||
person: z.string().optional(),
|
||||
description: z
|
||||
.string()
|
||||
.min(1, {
|
||||
|
|
@ -205,16 +197,6 @@ export default function RequestStep2() {
|
|||
setCharCount(newCharCount);
|
||||
}
|
||||
}
|
||||
|
||||
function handlePersonCharCountChange(
|
||||
event: React.ChangeEvent<HTMLInputElement>
|
||||
) {
|
||||
const newCharCount = event.target.value.length;
|
||||
// Update charCount only when the user types or removes characters
|
||||
if (newCharCount <= 50) {
|
||||
setCharCountPerson(newCharCount);
|
||||
}
|
||||
}
|
||||
// Add the useEffect hook to monitor changes in the description field
|
||||
useEffect(() => {
|
||||
setCharCount(form.watch("description").length);
|
||||
|
|
@ -293,7 +275,7 @@ export default function RequestStep2() {
|
|||
<Form {...form}>
|
||||
<form
|
||||
onSubmit={form.handleSubmit(onSubmit)}
|
||||
className="flex flex-col w-full mt-6 max-sm:gap-4"
|
||||
className="flex flex-col w-full mt-6"
|
||||
>
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
@ -313,7 +295,7 @@ export default function RequestStep2() {
|
|||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
<div className="flex flex-row flex-wrap justify-between max-sm:gap-4">
|
||||
<div className="flex flex-row flex-wrap justify-between">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="OrganizationId"
|
||||
|
|
@ -361,22 +343,12 @@ export default function RequestStep2() {
|
|||
render={({ field }) => (
|
||||
<FormItem className=" w-full sm:w-[48%]">
|
||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||
فرد مرتبط({charCountPerson}/{50})
|
||||
فرد مربوطه
|
||||
</FormLabel>
|
||||
<FormControl>
|
||||
<Input
|
||||
placeholder="نام فرد مورد نظر خود را بنویسید"
|
||||
{...field}
|
||||
onChange={(e) => {
|
||||
const currentValue = e.target.value;
|
||||
if (currentValue.length <= 50) {
|
||||
field.onChange(e);
|
||||
handlePersonCharCountChange(e);
|
||||
} else {
|
||||
// Truncate the value to the allowed limit
|
||||
field.onChange(currentValue.substring(0, 50));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
|
|
@ -420,7 +392,7 @@ export default function RequestStep2() {
|
|||
)}
|
||||
/>
|
||||
|
||||
<div className="flex flex-row flex-wrap justify-between mb-2 max-sm:gap-4">
|
||||
<div className="flex flex-row flex-wrap justify-between mb-2">
|
||||
{/* Select Option */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
@ -523,19 +495,19 @@ export default function RequestStep2() {
|
|||
}}
|
||||
/>
|
||||
</div>
|
||||
{!error ? (
|
||||
{/* {!error ? (
|
||||
<FormDescription className=" text-xs my-1 ">
|
||||
<span>
|
||||
حجم هر فایل حداکثر می بایست{" "}
|
||||
{formatSize(optionsData?.maxFileSize)} باشد
|
||||
</span>
|
||||
و {" "}
|
||||
{formatSize(optionsData?.maxFileSize)} مگابایت باشد
|
||||
</span>{" "}
|
||||
و{" "}
|
||||
{`تعداد فایل های پیوست شده می بایست حداکثر ${optionsData?.maxFileCount} تا باشد.`}
|
||||
</FormDescription>
|
||||
) : (
|
||||
<FormMessage />
|
||||
)}
|
||||
{/* <FormMessage /> */}
|
||||
)} */}
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
);
|
||||
}}
|
||||
|
|
@ -594,10 +566,10 @@ export default function RequestStep2() {
|
|||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center w-full gap-2 mt-0 sm:justify-end">
|
||||
<div className="flex justify-center w-full gap-2 mt-4 sm:justify-end">
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-1/2 p-2 mb-3 text-center text-white sm:w-1/3 lg:w-1/4 bg-blue rounded-xl"
|
||||
className="w-1/2 p-2 mb-4 text-center text-white sm:w-1/3 lg:w-1/4 bg-blue rounded-xl"
|
||||
>
|
||||
{authorizedComplaintSubmitMutation.isPending ||
|
||||
complaintSubmitMutation.isPending ? (
|
||||
|
|
|
|||
|
|
@ -18,13 +18,8 @@ function convertDate(date: string) {
|
|||
.format("YYYY/M/DD");
|
||||
return convertedDate;
|
||||
}
|
||||
// const registeredAt = localStorage.getItem("registeredAt");
|
||||
// const convertedDate = registeredAt ? convertDate(registeredAt) : "Invalid Date";
|
||||
|
||||
|
||||
const currentDate = new Date();
|
||||
const formattedDate = currentDate.toISOString();
|
||||
const convertedDate = convertDate(formattedDate);
|
||||
const registeredAt = localStorage.getItem("registeredAt");
|
||||
const convertedDate = registeredAt ? convertDate(registeredAt) : "Invalid Date";
|
||||
|
||||
const PrintPage: React.FC<PrintPageProps> = ({
|
||||
contentRef,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ const SelectContent = React.forwardRef<
|
|||
<SelectPrimitive.Content
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
||||
position === "popper" &&
|
||||
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
||||
className
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const boxItems = [
|
|||
name: " گزارش فساد",
|
||||
icon: "/img/box1.svg",
|
||||
icon2: "/img/box1-hover.svg",
|
||||
description: "ارسال گزارش ",
|
||||
description: "ارسال گزارش با احراز هویت",
|
||||
link: "/RequestStep0",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue