This commit is contained in:
ariari04 2024-09-16 22:03:10 +06:00
parent 4c11bc460c
commit 9dda476c16
6 changed files with 30 additions and 13 deletions

View File

@ -2,7 +2,7 @@ import { AxiosError } from "axios";
import { apiInstance } from "@/shared/config/apiConfig"; import { apiInstance } from "@/shared/config/apiConfig";
import { getServerSession } from "next-auth"; import { getServerSession } from "next-auth";
import { authConfig } from "@/shared/config/authConfig"; import { authConfig } from "@/shared/config/authConfig";
import { Title } from "@/shared/ui"; import { Container, Title } from "@/shared/ui";
import ProfileNav from "@/widgets/ProfileNav/ProfileNav"; import ProfileNav from "@/widgets/ProfileNav/ProfileNav";
const Profile = async ({ const Profile = async ({
@ -33,11 +33,11 @@ const Profile = async ({
const data = await getProfile(); const data = await getProfile();
return ( return (
<div className="flex flex-col"> <div className="bg-[#FAFCFF]">
<Title text="Личный кабинет" className="mb-[50px]" /> <Container className="flex flex-col">
<ProfileNav report_count={data?.report_count as number} /> <ProfileNav report_count={data?.report_count as number} />
{children}
{children} </Container>
</div> </div>
); );
}; };

View File

@ -1,6 +1,7 @@
import { apiInstance } from "@/shared/config/apiConfig"; import { apiInstance } from "@/shared/config/apiConfig";
import { ITenders } from "@/shared/types/tenders-type"; import { ITenders } from "@/shared/types/tenders-type";
import { Container, Title } from "@/shared/ui"; import { Container, Title } from "@/shared/ui";
import Link from "next/link";
const TenderDetails = async ({ const TenderDetails = async ({
params, params,
@ -11,7 +12,7 @@ const TenderDetails = async ({
const response = await apiInstance.get<ITenders>( const response = await apiInstance.get<ITenders>(
`/procurements/${params.id}/` `/procurements/${params.id}/`
); );
console.log(response.data); console.log(response.data.saved_files);
return response.data; return response.data;
}; };
@ -129,7 +130,12 @@ const TenderDetails = async ({
text="Больше информации в PDF" text="Больше информации в PDF"
className="text-[18px] text-gray-500 w-[242px]" 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>
</div> </div>

View File

@ -1,3 +1,4 @@
/* eslint-disable @next/next/no-img-element */
"use client"; "use client";
import Image from "next/image"; import Image from "next/image";
@ -10,6 +11,7 @@ import { useSession } from "next-auth/react";
import { useState } from "react"; import { useState } from "react";
import { AxiosError } from "axios"; import { AxiosError } from "axios";
import Loader from "@/shared/ui/Loader/Loader"; import Loader from "@/shared/ui/Loader/Loader";
import profile from "./icons/profile.png";
interface IProfileAvatarProps { interface IProfileAvatarProps {
img: string; img: string;
@ -29,7 +31,7 @@ const ProfileAvatar: React.FC<IProfileAvatarProps> = ({
const session = useSession(); const session = useSession();
const router = useRouter(); const router = useRouter();
const def = "lflvl"; const def = profile;
const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => { const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
if (e.target.files) { if (e.target.files) {
setDisplayImage(e.target.files[0]); setDisplayImage(e.target.files[0]);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -8,6 +8,14 @@ export interface Lot {
address_of_lots: string; address_of_lots: string;
procurement: number; procurement: number;
} }
export interface SavedFile {
id: number;
file_url: string;
name: string;
file_path: string;
procurement: number;
}
export interface ITenders { export interface ITenders {
id: number; id: number;
id_of_card: string; id_of_card: string;
@ -23,6 +31,7 @@ export interface ITenders {
more_info_url: string; more_info_url: string;
more_info_pdf: string; more_info_pdf: string;
lots: Lot[]; lots: Lot[];
saved_files: SavedFile[];
} }
export interface ITendersList extends IList { export interface ITendersList extends IList {

View File

@ -21,16 +21,16 @@ const ProfileNav: React.FC<IProfileNavProps> = ({
> >
Личные данные Личные данные
</Link> </Link>
<Link {/* <Link
id={pathname === "/profile/my-reports" ? "profile-nav__link" : ""} id={pathname === "/profile/my-reports" ? "profile-nav__link" : ""}
href="/profile/my-reports" href="/profile/my-reports"
className="text-[20px] font-semibold leading-6 text-gray-500" className="text-[20px] font-semibold leading-6 text-gray-500"
> >
Мои обращения Мои обращения
</Link> </Link> */}
<span className="ml-4 py-[2px] px-[10px] rounded-md bg-white text-[14px] font-semibold leading-6 text-light-blue cursor-auto "> {/* <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} {report_count}
</span> </span> */}
</div> </div>
{pathname === "/profile/personal" ? ( {pathname === "/profile/personal" ? (