Merge branch 'Kahdooei'
commit
248ccea133
|
|
@ -0,0 +1,16 @@
|
|||
import NavbarPanel from "@/components/NavbarPanel";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
<NavbarPanel />
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<div>page</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -47,7 +47,7 @@ export default function Landing() {
|
|||
// width={20}
|
||||
// height={20}
|
||||
quality={100}
|
||||
className=" w-full h-full bg-cover"
|
||||
className=" w-full h-full object-cover"
|
||||
/>
|
||||
</SwiperSlide>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -91,3 +91,14 @@
|
|||
}
|
||||
|
||||
|
||||
.printPage{
|
||||
background-color: antiquewhite;
|
||||
color: black;
|
||||
direction: rtl;
|
||||
font-family: sans-serif;
|
||||
font-size: medium;
|
||||
padding: 1em;
|
||||
border: 2px solid black;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
/* styles/print-styles.css */
|
||||
|
||||
@media print {
|
||||
|
||||
/* Add styles for the print window */
|
||||
body {
|
||||
font-size: larger;
|
||||
color: red;
|
||||
background-color: aquamarine;
|
||||
padding: 2em;
|
||||
/* Add any other print-specific styles */
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
"use client";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import React, { useEffect, useState, useRef } from "react";
|
||||
import Image from "next/image";
|
||||
import Resultimg from "../public/img/followResult.png";
|
||||
import Link from "next/link";
|
||||
|
|
@ -21,6 +21,9 @@ import { Button } from "@/components/ui/button";
|
|||
import { IoMdClose } from "react-icons/io";
|
||||
import { postComplaintTracking } from "@/utils/citizenApi";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
|
||||
import '../app/print-styles.css';
|
||||
|
||||
export default function FollowResult() {
|
||||
const router = useRouter();
|
||||
|
|
@ -28,6 +31,14 @@ export default function FollowResult() {
|
|||
const [password, setPassword] = useState<any>();
|
||||
const [complaintData, setComplaintData] = useState<any>();
|
||||
|
||||
|
||||
// Print component Data
|
||||
const componentRef = useRef<HTMLDivElement>(null);
|
||||
const handlePrint = useReactToPrint({
|
||||
content: () => componentRef.current
|
||||
});
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
setTrackingNumber(localStorage.getItem("trackingNumber2"));
|
||||
setPassword(localStorage.getItem("password2"));
|
||||
|
|
@ -60,12 +71,9 @@ export default function FollowResult() {
|
|||
});
|
||||
}
|
||||
|
||||
function handlePrint() {
|
||||
var prtContent = document.getElementById("details");
|
||||
// document.body.innerHTML= printContents;
|
||||
// window.document.write(prtContent?.innerHTML);
|
||||
window.print();
|
||||
}
|
||||
|
||||
const printableContent = 'This is the content to be printed.';
|
||||
|
||||
return (
|
||||
<div className="w-full h-full sm:w-2/3 md:w-3/4 lg:w-1/2 max-sm:p-8 pt-12">
|
||||
<div className="h-full flex flex-col justify-center">
|
||||
|
|
@ -121,7 +129,7 @@ export default function FollowResult() {
|
|||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div id="details">
|
||||
<div dir="rtl" className=" font-[yekan]" id="details" ref={componentRef} >
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
{" "}
|
||||
موضوع شکایت:{" "}
|
||||
|
|
@ -151,6 +159,7 @@ export default function FollowResult() {
|
|||
در دست بررسی و اقدام می باشد. در صورت تمایل می توانید با
|
||||
شماره تلفن 0353286545 جهت پشتیبانی تماس حاصل کنید.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
)}
|
||||
</AlertDialogDescription>
|
||||
|
|
@ -163,6 +172,7 @@ export default function FollowResult() {
|
|||
>
|
||||
پرینت گزارش
|
||||
</Button>
|
||||
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
|
|
|||
|
|
@ -84,14 +84,14 @@ export default function FollowUp() {
|
|||
});
|
||||
|
||||
function onSubmit(data: z.infer<typeof FormSchema>) {
|
||||
toast({
|
||||
title: "You submitted the following values:",
|
||||
description: (
|
||||
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4 pt-12">
|
||||
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
|
||||
</pre>
|
||||
),
|
||||
});
|
||||
// toast({
|
||||
// title: "You submitted the following values:",
|
||||
// description: (
|
||||
// <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4 pt-12">
|
||||
// <code className="text-white">{JSON.stringify(data, null, 2)}</code>
|
||||
// </pre>
|
||||
// ),
|
||||
// });
|
||||
|
||||
console.log(data);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default function Navbar() {
|
|||
<div className={`max-md:hidden left-0 right-0 top-0 z-10 ${pathname === "/" ? "absolute" : "sticky"}`}>
|
||||
|
||||
<TopNav />
|
||||
<div className=" bg-white h-20 shadow-md flex items-center justify-between py-2 px-8">
|
||||
<div className=" bg-white h-16 shadow-md flex items-center justify-between py-2 px-8">
|
||||
<div className=" flex ">
|
||||
<div className=" flex items-center ">
|
||||
<Image
|
||||
|
|
@ -39,7 +39,7 @@ export default function Navbar() {
|
|||
if (array.length - 1 !== index){
|
||||
return (
|
||||
<Link key={item.id} href={item.href}>
|
||||
<div className=" text-sm">{item.name}</div>
|
||||
<div className=" text-sm font-bold">{item.name}</div>
|
||||
</Link>
|
||||
);
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ export default function NavbarPanel() {
|
|||
<div
|
||||
className="fixed flex flex-col-reverse justify-between items-start gap-3
|
||||
sm:flex-row sm:items-center sm:gap-0
|
||||
w-full px-8 py-2 z-10 bg-blue max-md:px-4
|
||||
w-full px-8 py-1 z-10 bg-blue max-md:px-4
|
||||
"
|
||||
>
|
||||
<div className=" flex items-center gap-8 max-md:gap-4">
|
||||
<p className="text-white inline-block bg-clip-text text-lg font-bold max-md:text-base max-md:font-medium">
|
||||
<p className="text-white inline-block bg-clip-text text-sm font-bold max-md:text-xs max-md:font-medium">
|
||||
پنل کاربری |
|
||||
</p>
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ export default function NavbarPanel() {
|
|||
return (
|
||||
<Link key={item.id} href={item.href}>
|
||||
<p
|
||||
className="text-white font-normal text-sm max-md:text-xs
|
||||
className="text-white font-normal text-sm max-md:text-xs
|
||||
hover:bg-white/50 rounded-sm p-1
|
||||
animate-out duration-300 "
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
import React from 'react'
|
||||
import { Button } from './ui/button'
|
||||
|
||||
export default function PrintPage() {
|
||||
function handlePrint() {
|
||||
window.print()
|
||||
//the window.print() command is what is telling the browser to print the page
|
||||
}
|
||||
return (
|
||||
<Button onClick={handlePrint}> Print </Button>
|
||||
//the onClick function is built into React to look for a click event!
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -368,19 +368,6 @@ export default function RequestStep2() {
|
|||
</div>
|
||||
{/* Captcha */}
|
||||
<div className="flex flex-row flex-wrap justify-between">
|
||||
<div className="w-full sm:w-[48%] flex items-center justify-start">
|
||||
{!isLoading && (
|
||||
<Image
|
||||
alt="icon"
|
||||
src={srcForImage as string}
|
||||
className="w-3/5 h-12 rounded-md shadow-md"
|
||||
width={150}
|
||||
height={20}
|
||||
quality={100}
|
||||
/>
|
||||
)}
|
||||
{/* <Image src={Img1} alt="1" width={50} height={50} /> */}
|
||||
</div>
|
||||
|
||||
<FormField
|
||||
control={form.control}
|
||||
|
|
@ -400,6 +387,21 @@ export default function RequestStep2() {
|
|||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<div className="w-full sm:w-[48%] flex items-center justify-start">
|
||||
{!isLoading && (
|
||||
<Image
|
||||
alt="icon"
|
||||
src={srcForImage as string}
|
||||
className="w-3/5 h-12 rounded-md shadow-md"
|
||||
width={150}
|
||||
height={20}
|
||||
quality={100}
|
||||
/>
|
||||
)}
|
||||
{/* <Image src={Img1} alt="1" width={50} height={50} /> */}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="flex justify-center sm:justify-end gap-2 w-full mt-4">
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@ export default function TopNav() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
|
||||
className={`flex justify-between items-center w-full px-8 py-1 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
|
||||
pathname === "/" ? "bg-transparent" : "bg-white"
|
||||
} `}
|
||||
>
|
||||
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text max-md:hidden">
|
||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-xs max-md:hidden font-bold">
|
||||
سال 1402 | مهارم تورم، رشد تولید
|
||||
</h1>
|
||||
</p>
|
||||
{/* <p>Current pathname: {pathname}</p> */}
|
||||
<div className="flex items-center gap-10">
|
||||
<div className=" flex items-center gap-3 md:ml-4">
|
||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-xs max-md:text-xs font-bold">
|
||||
امروز: چهارشنبه 24 آبان 1402
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|||
className={cn(
|
||||
`flex w-full rounded-md border border-input px-3 py-2 ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50
|
||||
text-black text-opacity-50 text-xs font-normal bg-slate-200 mb-3
|
||||
3xl:h-12 h-10 transition-all
|
||||
3xl:h-9 h-10 transition-all
|
||||
hover:bg-slate-300 hover:cursor-pointer focus:cursor-auto
|
||||
focus:outline-4 focus:outline-slate-300 focus:bg-slate-200
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
"react-otp-input": "^3.1.1",
|
||||
"react-responsive": "^9.0.2",
|
||||
"react-spinners": "^0.13.8",
|
||||
"react-to-print": "^2.14.15",
|
||||
"react-use": "^17.4.2",
|
||||
"sonner": "^1.3.1",
|
||||
"swiper": "^11.0.5",
|
||||
|
|
@ -7740,6 +7741,15 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"node_modules/react-to-print": {
|
||||
"version": "2.14.15",
|
||||
"resolved": "https://registry.npmjs.org/react-to-print/-/react-to-print-2.14.15.tgz",
|
||||
"integrity": "sha512-SKnwOzU2cJ8eaAkoJO7+gNhvfEDmm+Y34IdcHsjtHioUevUPhprqbVtvNJlZ2JkGJ8ExK2QNWM9pXECTDR5D8w==",
|
||||
"peerDependencies": {
|
||||
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/react-universal-interface": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/react-universal-interface/-/react-universal-interface-0.6.2.tgz",
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
"react-otp-input": "^3.1.1",
|
||||
"react-responsive": "^9.0.2",
|
||||
"react-spinners": "^0.13.8",
|
||||
"react-to-print": "^2.14.15",
|
||||
"react-use": "^17.4.2",
|
||||
"sonner": "^1.3.1",
|
||||
"swiper": "^11.0.5",
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@
|
|||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "tailwind.config.js"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "tailwind.config.js", "components/Resume.jsx"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue