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 { 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 (
<div className="flex flex-col">
<Title text="Личный кабинет" className="mb-[50px]" />
<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>
);
};

View File

@ -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>

View File

@ -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]);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -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 {

View File

@ -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" ? (