From 9dda476c16c0683b6cb51404c720bc6ee6c7a738 Mon Sep 17 00:00:00 2001 From: ariari04 Date: Mon, 16 Sep 2024 22:03:10 +0600 Subject: [PATCH] fix --- src/app/[locale]/profile/layout.tsx | 12 ++++++------ src/app/[locale]/tenders/[id]/page.tsx | 10 ++++++++-- src/features/ProfileAvatar/ProfileAvatar.tsx | 4 +++- src/features/ProfileAvatar/icons/profile.png | Bin 0 -> 2975 bytes src/shared/types/tenders-type.ts | 9 +++++++++ src/widgets/ProfileNav/ProfileNav.tsx | 8 ++++---- 6 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 src/features/ProfileAvatar/icons/profile.png diff --git a/src/app/[locale]/profile/layout.tsx b/src/app/[locale]/profile/layout.tsx index f2517f6..1c8ba27 100644 --- a/src/app/[locale]/profile/layout.tsx +++ b/src/app/[locale]/profile/layout.tsx @@ -2,7 +2,7 @@ import { AxiosError } from "axios"; import { apiInstance } from "@/shared/config/apiConfig"; import { getServerSession } from "next-auth"; import { authConfig } from "@/shared/config/authConfig"; -import { Title } from "@/shared/ui"; +import { Container, Title } from "@/shared/ui"; import ProfileNav from "@/widgets/ProfileNav/ProfileNav"; const Profile = async ({ @@ -33,11 +33,11 @@ const Profile = async ({ const data = await getProfile(); return ( -
- - <ProfileNav report_count={data?.report_count as number} /> - - {children} + <div className="bg-[#FAFCFF]"> + <Container className="flex flex-col"> + <ProfileNav report_count={data?.report_count as number} /> + {children} + </Container> </div> ); }; diff --git a/src/app/[locale]/tenders/[id]/page.tsx b/src/app/[locale]/tenders/[id]/page.tsx index ccab891..53269de 100644 --- a/src/app/[locale]/tenders/[id]/page.tsx +++ b/src/app/[locale]/tenders/[id]/page.tsx @@ -1,6 +1,7 @@ import { apiInstance } from "@/shared/config/apiConfig"; import { ITenders } from "@/shared/types/tenders-type"; import { Container, Title } from "@/shared/ui"; +import Link from "next/link"; const TenderDetails = async ({ params, @@ -11,7 +12,7 @@ const TenderDetails = async ({ const response = await apiInstance.get<ITenders>( `/procurements/${params.id}/` ); - console.log(response.data); + console.log(response.data.saved_files); return response.data; }; @@ -129,7 +130,12 @@ const TenderDetails = async ({ text="Больше информации в PDF" className="text-[18px] text-gray-500 w-[242px]" /> - <Title text={data.more_info_pdf} className="text-[20px] leading-8" /> + <Link href={data.more_info_pdf} target="blank"> + <Title + text={data.more_info_pdf} + className="text-[20px] leading-8" + /> + </Link> </div> </div> diff --git a/src/features/ProfileAvatar/ProfileAvatar.tsx b/src/features/ProfileAvatar/ProfileAvatar.tsx index b17b5d3..a5ce434 100644 --- a/src/features/ProfileAvatar/ProfileAvatar.tsx +++ b/src/features/ProfileAvatar/ProfileAvatar.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @next/next/no-img-element */ "use client"; import Image from "next/image"; @@ -10,6 +11,7 @@ import { useSession } from "next-auth/react"; import { useState } from "react"; import { AxiosError } from "axios"; import Loader from "@/shared/ui/Loader/Loader"; +import profile from "./icons/profile.png"; interface IProfileAvatarProps { img: string; @@ -29,7 +31,7 @@ const ProfileAvatar: React.FC<IProfileAvatarProps> = ({ const session = useSession(); const router = useRouter(); - const def = "lflvl"; + const def = profile; const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => { if (e.target.files) { setDisplayImage(e.target.files[0]); diff --git a/src/features/ProfileAvatar/icons/profile.png b/src/features/ProfileAvatar/icons/profile.png new file mode 100644 index 0000000000000000000000000000000000000000..0f3555003ae70f4983131929e48fd91e518df279 GIT binary patch literal 2975 zcmV;Q3t;q#P)<h;3K|Lk000e1NJLTq007|t007|#0{{R332h=s0000^P)t-srlzL< z|Nrvx@}Z%j_V)ImprEIxr}y{w`}_N=tE>F{{Jp)s&CSiOuCBMYx8&sH-{0Tr>gvVC z#ksk;?d|Q=)z#G0)XB-o+uPfjnVHxp9cusp3k*p_K~#90?VZ_rtSS(NRRrgu?IFG2 z|3!~>cj5#H)I!bqvMzJc`lq0(D4-0&|GR>tU%<Qm2!Fr+2!Fr+2!Fr!CCu|QP4j%$ zXZj~hqvlz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z8Q~{hWQKsogr9+WKz(MZ=5^(5D_3(M4D;dC;BH$LYQ@7px-tf|APn=G9h=a62#bJi ze2UwZFbunY$0jsy!Us3VWE=^@6PU11+`8=-btVic=YLT$pMoxgVSY4UlyAQziLj51 zhw_<5K?-4bWWX>>)To39PDa}i>PmRjNVOlK?u3V!(b9(!3HLXnn*k|=JDbtbfF!~_ zovMQig%IvFRAUzx3L*^i9T-V`WJ3Sb(R~7<2>mjW`5=Ve7-Ik*h|tS?r1_UoAi@xB zNQn7f!Vv-ui5Z?BAqjh>fIFl}ybw+p5+Tuep%21dxl=wDCm`Q4mlwi8X=2q=A;BB( zBX5L*auduR&Wr87<(2TQJWZ2TQ^Dcped3wztsMvt)*s>T*B{~U*B{~U*B{~U*MBsi V*vbU|_&Wdq002ovPDHLkV1mK+rsx0w literal 0 HcmV?d00001 diff --git a/src/shared/types/tenders-type.ts b/src/shared/types/tenders-type.ts index dd53572..2245a7d 100644 --- a/src/shared/types/tenders-type.ts +++ b/src/shared/types/tenders-type.ts @@ -8,6 +8,14 @@ export interface Lot { address_of_lots: string; procurement: number; } + +export interface SavedFile { + id: number; + file_url: string; + name: string; + file_path: string; + procurement: number; +} export interface ITenders { id: number; id_of_card: string; @@ -23,6 +31,7 @@ export interface ITenders { more_info_url: string; more_info_pdf: string; lots: Lot[]; + saved_files: SavedFile[]; } export interface ITendersList extends IList { diff --git a/src/widgets/ProfileNav/ProfileNav.tsx b/src/widgets/ProfileNav/ProfileNav.tsx index ba8db16..d875668 100644 --- a/src/widgets/ProfileNav/ProfileNav.tsx +++ b/src/widgets/ProfileNav/ProfileNav.tsx @@ -21,16 +21,16 @@ const ProfileNav: React.FC<IProfileNavProps> = ({ > Личные данные </Link> - <Link + {/* <Link id={pathname === "/profile/my-reports" ? "profile-nav__link" : ""} href="/profile/my-reports" className="text-[20px] font-semibold leading-6 text-gray-500" > Мои обращения - </Link> - <span className="ml-4 py-[2px] px-[10px] rounded-md bg-white text-[14px] font-semibold leading-6 text-light-blue cursor-auto "> + </Link> */} + {/* <span className="ml-4 py-[2px] px-[10px] rounded-md bg-white text-[14px] font-semibold leading-6 text-light-blue cursor-auto "> {report_count} - </span> + </span> */} </div> {pathname === "/profile/personal" ? (