Added part of myRequest and myRequestDetails Page

master
YasamanKahdooei 2024-05-01 12:29:10 +03:30
parent 4abc1360d3
commit 66dcd0b0b8
6 changed files with 178 additions and 9 deletions

View File

@ -0,0 +1,12 @@
import RequestDetails from '@/components/Requests/RequestDetails'
import React from 'react'
function page() {
return (
<div>
<RequestDetails />
</div>
)
}
export default page

View File

@ -1,13 +1,12 @@
import RequestList from "@/components/RecentRequest/RequestList"; import RequestList from "@/components/RecentRequest/RequestList";
import RequestCard from "@/components/Requests/RequestCard";
import React from "react"; import React from "react";
export default function page() { export default function page() {
return ( return (
<section className="flex w-full md:grid md:grid-cols-2 h-full items-center flex-col overflow-y-auto p-5"> <section className="flex w-full md:grid md:grid-cols-2 h-full items-center flex-col overflow-y-auto p-5 scrollbar-thin scrollbar-thumb-yellow scrollbar-track-white">
<RequestList <RequestCard />
// source={{ controller: "CitizenReport", params: { tail: "Mine" } }} {/* <RequestList /> */}
// isSelfRequest={true}
/>
</section> </section>
); );
} }

View File

@ -11,7 +11,7 @@ export default function RequestLayout({
{/* Include shared UI here e.g. a header or sidebar */} {/* Include shared UI here e.g. a header or sidebar */}
<SideMenu /> <SideMenu />
<UserHeader /> <UserHeader />
<div className=" w-[calc(100%-208px)] h-[calc(100%-100px)] flex flex-1 p-10 flex-col overflow-hidden fixed top-[60px] left-0 transition-all ">{children}</div> <div className=" w-[calc(100%-208px)] h-[calc(100%-100px)] flex flex-1 p-10 flex-col overflow-hidden overflow-y-scroll fixed top-[60px] left-0 transition-all scrollbar-thin scrollbar-thumb-yellow scrollbar-track-white">{children}</div>
</section> </section>
); );
} }

View File

@ -8,7 +8,7 @@ const ProgressBarProviders = ({ children }: { children: React.ReactNode }) => {
{children} {children}
<ProgressBar <ProgressBar
height="4px" height="4px"
color="#29D" color="#E44D26"
options={{ showSpinner: false }} options={{ showSpinner: false }}
shallowRouting shallowRouting
/> />

View File

@ -7,10 +7,12 @@ import RequestProcessIcon from "./RequestProcessIcon";
import RequestViolation from "./RequestViolation"; import RequestViolation from "./RequestViolation";
import RequestLike from "./RequestLike"; import RequestLike from "./RequestLike";
import RequestComments from "./RequestComments"; import RequestComments from "./RequestComments";
import Link from "next/link";
const RequestCard = () => { const RequestCard = () => {
return ( return (
<article <Link
href={`MyRequest/${1}`}
className="w-full bg-white flex items-stretch mb-3 min-h-[170px] md:p-3 md:rounded-md md:border-0 md:shadow-[0_2px_5px_rgba(0,0,0,0.05)]" className="w-full bg-white flex items-stretch mb-3 min-h-[170px] md:p-3 md:rounded-md md:border-0 md:shadow-[0_2px_5px_rgba(0,0,0,0.05)]"
style={{ direction: "rtl" }} style={{ direction: "rtl" }}
> >
@ -58,7 +60,7 @@ const RequestCard = () => {
</div> </div>
</div> </div>
</div> </div>
</article> </Link>
); );
}; };

View File

@ -0,0 +1,156 @@
import React from "react";
import Image from "next/image";
import img1 from "@/assets/images/no-image.jpeg";
import RequestStatus from "./RequestStatus";
import { MdLocationOn } from "react-icons/md";
function RequestDetails() {
return (
<div className="w-full max-w-[640px] m-auto flex items-center flex-col p-5">
{/* Loading */}
{/* SeuccesFull */}
{/* Card 1 DetailsCard*/}
<div className="w-full rounded-xl bg-white overflow-hidden mb-5 shadow-[0_0_2px_1px_rgba(0,0,0,0.1)]">
<div className="w-full h-[200px] m-0 py-5 px-0">
<Image
src={img1}
className="w-full h-full object-contain"
alt="imgDetails"
/>
</div>
<div className="w-full p-3">
<RequestStatus />
<p className="text-xs font-bold text-black my-3 mx-0">
عنوان دسته بندی{" "}
</p>
{/* I dont Know */}
{/* {forms?.values ? (
<>
<div className=" flex flex-col gap-2 text-xl my-2">
{forms?.values && (
<>
{Object.keys(forms.values).map((key, item) => {
console.log(forms?.values[key]);
if (typeof forms?.values[key].value == "string") {
return (
<div className="">
<span>{forms?.values[key].name}</span>:{" "}
<span className=" text-gray-500">
{forms?.values[key].value}
</span>
</div>
);
} else if (
typeof forms?.values[key].value == "object" &&
!Array.isArray(forms?.values[key].value)
) {
return (
<div>
{forms?.values[key].name}:{" "}
<span className=" text-gray-500">
{forms?.values[key].value.title}
</span>
</div>
);
} else if (Array.isArray(forms?.values[key].value)) {
return (
<span className=" flex gap-1">
<span>{forms?.values[key].name}:</span>
<span className=" flex gap-1 text-gray-500">
<>
{forms?.values[key].value.map((item, idx) => {
if (item?.name) {
return (
<span>
{item?.name}{" "}
{forms?.values[key].value.length - 1 !=
idx && ","}
</span>
);
} else if (item?.title) {
return (
<span>
{item.title}
{forms?.values[key].value.length - 1 !=
idx && ","}
</span>
);
}
})}
</>
</span>
</span>
);
}
})}
</>
)}
</div>
</>
) : (
<p className={styles.requestComments}>{request.comments}</p>
)} */}
<div className="w-full flex items-center justify-between mb-2">
<p className="text-xs text-gray-400 font-bold">
<span>کد رهگیری: </span>
<span>شماره رهگیری </span>
</p>
<p className="text-xs text-gray-400 font-bold">تاریخ درخواست</p>
</div>
</div>
</div>
{/* Card 2 AddressCard*/}
<div className="w-full rounded-xl bg-white overflow-hidden mb-5 shadow-[0_0_2px_1px_rgba(0,0,0,0.1)]">
<h2 className="p-3">نشانی</h2>
{/* <Map /> */}
<Image src={img1} alt="11" />
<div className="w-full p-3">
<div className="w-full flex items-center justify-start">
<MdLocationOn className="text-blue ml-1 text-xl" />
<p className="text-sm text-black font-bold">متن آدرس</p>
</div>
</div>
</div>
{/*Card 3 OtherDetailsCard */}
<div className="w-full rounded-xl bg-white overflow-hidden mb-5 shadow-[0_0_2px_1px_rgba(0,0,0,0.1)]">
<div className="w-full p-3 leading-loose">
<div className="w-full flex items-center mb-4">
<p className="text-[15px] font-bold text-black ml-[5px]">زمان پاسخگویی : </p>
<p className="text-sm text-black">نمایش زمان</p>
</div>
<div className="w-full flex items-center mb-4">
<p className="text-[15px] font-bold text-black ml-[5px]">زمان اتمام : </p>
<p className="text-sm text-black">نمایش زمان</p>
</div>
<div className="w-full flex items-center mb-4">
<p className="text-[15px] font-bold text-black ml-[5px]">تعداد نظرات : </p>
<p className="text-sm text-black">نمایش تعداد</p>
</div>
<div className="w-full flex items-center mb-4">
<p className="text-[15px] font-bold text-black ml-[5px]">تعداد پسندها : </p>
<p className="text-sm text-black">نمایش تعداد</p>
</div>
<div className="w-full flex items-center mb-4">
<p className="text-[15px] font-bold text-black ml-[5px]">هویت : </p>
<p className="text-sm text-black">مخفی یا قابل رویت</p>
</div>
</div>
</div>
</div>
);
}
export default RequestDetails;