Compare commits

...

3 Commits

5 changed files with 35 additions and 9 deletions

View File

@ -29,7 +29,7 @@ export default function Footer() {
</h2>
<div>
<p className=" text-white text-xs md:text-sm font-normal md:leading-7">
<p className=" text-white text-xs md:text-sm font-normal md:leading-7 text-justify">
<div
className=" !text-white footer"
dangerouslySetInnerHTML={{ __html: fetchedContent }}

View File

@ -30,7 +30,7 @@ export default function Navbar() {
setAuth(false);
}
}, [isAuth, token]);
console.log(pathname);
return (
<div className={` left-0 right-0 top-0 z-20 fixed`}>
{/* <TopNav /> */}

View File

@ -34,7 +34,6 @@ export default function Result() {
const handlePrint = useReactToPrint({
// content: () => contentRef.current,
content: () => {
console.log(contentRef.current); // Log the content to the console
return contentRef.current;
},
});

View File

@ -132,9 +132,13 @@ export default function RequestStep2() {
mutationKey: ["authorizedComplaintSubmit"],
mutationFn: postAuthorizedComplaintSubmit,
onSuccess: (res) => {
const currentDate = new Date();
const formattedDate = currentDate.toISOString()
localStorage.setItem("trackingNumber", res.trackingNumber);
localStorage.setItem("password", res.password);
localStorage.setItem("registeredAt", res.registeredAt);
// localStorage.setItem("registeredAt", res.registeredAt);
localStorage.setItem("registeredAt", formattedDate);
localStorage.removeItem("authorized");
localStorage.removeItem("unknown");
router.push("/RequestResult");

View File

@ -1,5 +1,7 @@
// components/PrintPage.tsx
import React from "react";
"use client";
import React, { useEffect } from "react";
// import { convertDate } from "@/lib/utils";
import dayjs from "dayjs";
interface PrintPageProps {
contentRef: React.RefObject<any>;
@ -8,6 +10,17 @@ interface PrintPageProps {
password: string;
}
// Convert Date
function convertDate(date: string) {
const convertedDate = dayjs(date)
.calendar("jalali")
.locale("fa")
.format("YYYY/M/DD");
return convertedDate;
}
const registeredAt = localStorage.getItem("registeredAt");
const convertedDate = registeredAt ? convertDate(registeredAt) : "Invalid Date";
const PrintPage: React.FC<PrintPageProps> = ({
contentRef,
fetchedContent,
@ -20,9 +33,19 @@ const PrintPage: React.FC<PrintPageProps> = ({
className="w-screen h-screen border-2 border-spacing-6 p-36 bg-slate-200 bg-[url('/img/bg-print.jpg')] bg-no-repeat bg-bottom bg-cover font-[yekan]"
dir="rtl"
>
<div dangerouslySetInnerHTML={{ __html: fetchedContent }} className=" mt-16 text-justify" />
<div className="flex flex-col absolute top-7 left-28 text-xs gap-1">
<p>سامانه نظارت شهرداری یزد</p>
<p>
تاریخ: <span>{convertedDate}</span>
</p>
</div>
<p >
<div
dangerouslySetInnerHTML={{ __html: fetchedContent }}
className=" mt-16 text-justify"
/>
<p>
کد پیگیری : <span>{trackingNumber}</span>
</p>