diff --git a/app/CitizenLogin/page.tsx b/app/CitizenLogin/page.tsx index f7d8040..f8de261 100644 --- a/app/CitizenLogin/page.tsx +++ b/app/CitizenLogin/page.tsx @@ -9,5 +9,11 @@ export default function page() { if (token) { redirect("/RequestStep2"); } - return ; + return ( +
+ + +
+
+ ); } diff --git a/app/RequestStep0/page.tsx b/app/RequestStep0/page.tsx new file mode 100644 index 0000000..88c89cd --- /dev/null +++ b/app/RequestStep0/page.tsx @@ -0,0 +1,12 @@ +import RequestStep0 from "@/components/RequestStep0"; +import React from "react"; + +export default function page() { + return ( +
+ + +
+
+ ); +} diff --git a/app/components/Landing.tsx b/app/components/Landing.tsx index 5b914a1..7ebb015 100644 --- a/app/components/Landing.tsx +++ b/app/components/Landing.tsx @@ -130,11 +130,13 @@ export default function Landing() {
-
+ {/* About Oyoon */} + +
{boxItems.map((item, index) => { return ( */} {/*SubmitRequest */} - {/* Footer */}
diff --git a/app/globals.css b/app/globals.css index 9fdf562..ac25a62 100644 --- a/app/globals.css +++ b/app/globals.css @@ -86,6 +86,11 @@ src: url(../fonts/iranyekanwebmediumfanum.ttf); } +@font-face { + font-family: "yekan-eng"; + src: url(../fonts/IRANYekanRegular.ttf); +} + .leaflet-container { width: 100%; height: 100vh; diff --git a/components/AttachmentsDialog.tsx b/components/AttachmentsDialog.tsx index ec931cc..98e4233 100644 --- a/components/AttachmentsDialog.tsx +++ b/components/AttachmentsDialog.tsx @@ -8,44 +8,59 @@ import { DialogTrigger, } from "@/components/ui/dialog"; import { X } from "lucide-react"; +import { Button } from "./ui/button"; export default function AttachmentsDialog({ children, attachments, deleteFile, + deleteAllAttachmentsFiles, }: { children: React.ReactNode; attachments: File[] | []; deleteFile: (file: any) => void; + deleteAllAttachmentsFiles: () => void; }) { return ( {children} - + - پیوست‌ها - + پیوست‌ها + + {attachments.length != 0 && ( + + )} + {attachments.length == 0 ? (
هیج پیوستی وجود ندارد.
) : ( -
- {attachments?.map((item,index) => { - return ( -
-
- {index + 1} -
-
-
-

{item.name}

-
- - deleteFile(item.name)} - className=" cursor-pointer hover:drop-shadow-md" - /> -
+
+ {attachments?.map((item, index) => { + return ( +
+
+ {index + 1}
- ); +
+
+

{item.name}

+
+ + deleteFile(item.name)} + className=" cursor-pointer hover:drop-shadow-md" + /> +
+
+ ); })}
)} diff --git a/components/Navbar.tsx b/components/Navbar.tsx index a3608dd..5c353d9 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -30,7 +30,7 @@ export default function Navbar() { setAuth(false); } }, [isAuth, token]); - + return (
{/* */} @@ -74,7 +74,7 @@ export default function Navbar() { setOpen((prev) => !prev)} className={`flex items-center justify-between w-full p-3 rounded-xl text-white - ${lastItem === idx ? "bg-yellow" : "bg-blue"} `} + bg-blue `} href={item.href} > @@ -107,7 +107,7 @@ export default function Navbar() { setOpen((prev) => !prev)} className={`flex items-center justify-between w-full p-3 rounded-xl text-white - ${lastItem === idx ? "bg-yellow" : "bg-blue"} `} + bg-blue `} href={item.href} > @@ -128,12 +128,12 @@ export default function Navbar() {
log diff --git a/components/NavbarSm.tsx b/components/NavbarSm.tsx index 3663171..8e5462b 100644 --- a/components/NavbarSm.tsx +++ b/components/NavbarSm.tsx @@ -37,7 +37,12 @@ export default function NavbarSm() { sticky top-0 shadow-md`} > - + {auth && } {/* ); }; diff --git a/components/RequestResult.tsx b/components/RequestResult.tsx index 337323c..c2e3694 100644 --- a/components/RequestResult.tsx +++ b/components/RequestResult.tsx @@ -72,14 +72,15 @@ export default function Result() { 3xl:text-base 3xl:font-bold " > کد پیگیری : - {`${trackingNumber}`} + {`${trackingNumber}`}

- رمز عبور :{`${password}`} + رمز عبور : + {`${password}`}

{/* */}
-
+
+ {RequestItems.map((item, index) => { + return ( + { + localStorage.removeItem("Sootzani_Login_State"); + if (index == 0) { + localStorage.setItem("unknown", "true"); + } + if (index == 1) { + localStorage.removeItemItem("unknown"); + } + }} + > +

+ {item.description} +

+

+ {item.name} +

+ + icon + + icon + + ); + })} +
+
+ ); +} diff --git a/components/RequestStep1.tsx b/components/RequestStep1.tsx index 556dce3..5453a38 100644 --- a/components/RequestStep1.tsx +++ b/components/RequestStep1.tsx @@ -90,12 +90,12 @@ export default function RequestStep1() { const payload = data; editProfileMutation.mutate(payload); } - + return (

- لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید. + فرم ثبت درخواست{" "}

{profileData && (
@@ -140,7 +140,6 @@ export default function RequestStep1() { )} /> -
diff --git a/components/RequestStep2.tsx b/components/RequestStep2.tsx index 88c3c92..5b22829 100644 --- a/components/RequestStep2.tsx +++ b/components/RequestStep2.tsx @@ -87,7 +87,7 @@ export default function RequestStep2() { .min(1, { message: "لطفا توضیحات خود را بنویسید.", }) - .max(1024, { + .max(optionsData?.maxTextLength, { message: "تعداد کاراکترها بیشتر از حد مجاز میباشد.", }), uploadFile: z @@ -188,6 +188,15 @@ export default function RequestStep2() { }, }); + function handleDescriptionChange( + event: React.ChangeEvent + ) { + const newCharCount = event.target.value.length; + // Update charCount only when the user types or removes characters + if (newCharCount <= optionsData?.maxTextLength) { + setCharCount(newCharCount); + } + } // Add the useEffect hook to monitor changes in the description field useEffect(() => { setCharCount(form.watch("description").length); @@ -235,6 +244,11 @@ export default function RequestStep2() { form.setValue("uploadFile", filtered); }; + const deleteAllAttachmentsFiles = () => { + setFile([]); + form.setValue("uploadFile", []); + }; + const allowedExtensions = optionsData?.allowedExtensions; const split = allowedExtensions?.split(","); const withDot = split?.map((item: string) => "." + item); @@ -250,8 +264,11 @@ export default function RequestStep2() { return (
-
-

+

+ + ارسال گزارش + +

لطفا جهت ارسال درخواست فرم زیر را تکمیل نمایید.

@@ -266,7 +283,7 @@ export default function RequestStep2() { render={({ field }) => ( - *موضوع گزارش + *موضوع گزارش ( - *واحد مورد گزارش + *واحد مورد گزارش