From 3fecbcd880853c1096c5dd432268c4776acab9b7 Mon Sep 17 00:00:00 2001 From: ariari04 Date: Tue, 17 Sep 2024 21:36:59 +0600 Subject: [PATCH] tender card --- package-lock.json | 11 ++++++++ package.json | 1 + src/entities/TenderCard.tsx | 33 +++++++++++++++++++----- src/entities/icons/map-pin.png | Bin 0 -> 700 bytes src/shared/types/tenders-type.ts | 3 ++- src/widgets/TendersList/TendersList.tsx | 3 ++- 6 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/entities/icons/map-pin.png diff --git a/package-lock.json b/package-lock.json index 428dc0a..b328c70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,6 +18,7 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.52.2", + "react-number-format": "^5.4.2", "react-toastify": "^10.0.5", "sass": "^1.77.8", "tailwind-merge": "^2.5.2", @@ -4225,6 +4226,16 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "dev": true }, + "node_modules/react-number-format": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-5.4.2.tgz", + "integrity": "sha512-cg//jVdS49PYDgmcYoBnMMHl4XNTMuV723ZnHD2aXYtWWWqbVF3hjQ8iB+UZEuXapLbeA8P8H+1o6ZB1lcw3vg==", + "license": "MIT", + "peerDependencies": { + "react": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^0.14 || ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-toastify": { "version": "10.0.5", "resolved": "https://registry.npmjs.org/react-toastify/-/react-toastify-10.0.5.tgz", diff --git a/package.json b/package.json index 1969e2e..28fc178 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "react": "^18", "react-dom": "^18", "react-hook-form": "^7.52.2", + "react-number-format": "^5.4.2", "react-toastify": "^10.0.5", "sass": "^1.77.8", "tailwind-merge": "^2.5.2", diff --git a/src/entities/TenderCard.tsx b/src/entities/TenderCard.tsx index 45ab684..b56042c 100644 --- a/src/entities/TenderCard.tsx +++ b/src/entities/TenderCard.tsx @@ -1,6 +1,8 @@ import { Link } from "@/shared/config/navigation"; import { Title } from "@/shared/ui"; import React from "react"; +import mapPin from "./icons/map-pin.png"; +import Image from "next/image"; interface Props { id: number; @@ -12,7 +14,8 @@ interface Props { date_of_publication_datetime: string; date_of_offer_datetime: string; current_timestamp: string; - plan_summ: string; + plan_summ_decimal: string; + address_of_organization: string; } const TenderCard: React.FC = ({ id, @@ -24,12 +27,12 @@ const TenderCard: React.FC = ({ date_of_publication_datetime, date_of_offer_datetime, current_timestamp, - plan_summ, + plan_summ_decimal, + address_of_organization, }: Props) => { - console.log(plan_summ); return (
-
+
= ({ {name_of_organization} </h2> </div> - <div className="w-[285px]"> - <p className="text-[14px] leading-6">Планируемая сумма</p> - <Title text={plan_summ} /> + <div className="w-[290px]"> + <p className="text-[14px] leading-6 mb-[6px]">Планируемая сумма</p> + <Title + text={`${parseInt(plan_summ_decimal)} сом`} + className="font-extrabold text-[24px] leading-[38px] mb-4" + /> + <p className="text-[14px] leading-6 mb-4"> + Окончание приема заявок: {date_of_offer_datetime.slice(0, 10)} + </p> + <div className="text-[14px] leading-6 flex gap-2 items-baseline"> + <Image + src={mapPin} + alt="map" + width={20} + height={20} + className="object-cover" + /> + <p>{address_of_organization}</p> + </div> </div> </div> ); diff --git a/src/entities/icons/map-pin.png b/src/entities/icons/map-pin.png new file mode 100644 index 0000000000000000000000000000000000000000..b12530d877a9b61fa2d91fb1c761a53dc5d9889a GIT binary patch literal 700 zcmV;t0z>_YP)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%00009a7bBm000XU z000XU0RWnu7ytkO0drDELIAGL9O(c600d`2O+f$vv5yP<VFdsH0#QjsK~#7Fg_KcJ z;y@6FXC{L_S(QD(>J9J)aDsJD06y<x0a2@bB0gCK#$gxtSv|pe1Mmc!y#Y6nSIZ=A zcV?P|5VfmPkWTkE|8)0^6g3ux#^2lXx>Cw-_}Z#`UI4&D5S-lC<;tpKJT^_O8-Im> z{lW`N7hdwo<;%-!`{H7-d>3e8dX9g6f~2WD);fs?gTabpqUbj&7b6E>C5dXEpZ|!r zfLB*$e|NVrcgh~5O!{R|)vm8+_ezNlDV6f|kYg1G?Cdl~4z?H$d)+dO7Ne&OJU#7o zDVB1wO!YSu8e@C_{hT{wa)7X9p<3UGbz?T`hIviQ`$t=Md8=GunrfFI7Mn0C0l{G9 zp4>+QC<bF=t5W#PP*zpew7l$pQ39{!N)St#9t?*kUy3by-D2}LM@l;tN|X#hl$yX} zlRa@g0kS9e&EL+kKJ98_JEXj?>vc1=@H`q1)tOApqgCNyR{<d^E*7R7C>S<b#&$J0 z;;^%`-h%7nd3sI{PXTuLk>hYCTV;kSCDRK2WHM`UFpf_fKn@%@#_e5VH^1|D8gjb` zEFFWloY&`<lxl?AH28YR{vh}{#h<CDF^ab(5SQ#*H$|yz>dtI4if)bg#EhAZSY7#| zSOck(baw5^(7(C4?YsxWV|RqALi*1+TR<|ZLm?lg<ME$n6-E~bp5ePZ0%N&$wLr2U z=!FjIYn{zW4Syrmd>c^=#a8pT?nAaHnuYe7%10w~13YDAb+8YCRVdp>uup+xv}L7$ iy6)rf9+!u@&fWkwDJhruzRg?!0000<MNUMnLSTYWgfV^q literal 0 HcmV?d00001 diff --git a/src/shared/types/tenders-type.ts b/src/shared/types/tenders-type.ts index 2245a7d..1ab46ca 100644 --- a/src/shared/types/tenders-type.ts +++ b/src/shared/types/tenders-type.ts @@ -26,12 +26,13 @@ export interface ITenders { date_of_publication_datetime: string; date_of_offer_datetime: string; current_timestamp: string; - plan_summ: string; + plan_summ_decimal: string; tel_number: string; more_info_url: string; more_info_pdf: string; lots: Lot[]; saved_files: SavedFile[]; + address_of_organization: string; } export interface ITendersList extends IList { diff --git a/src/widgets/TendersList/TendersList.tsx b/src/widgets/TendersList/TendersList.tsx index b57ba13..cfd96f3 100644 --- a/src/widgets/TendersList/TendersList.tsx +++ b/src/widgets/TendersList/TendersList.tsx @@ -41,7 +41,8 @@ const TendersList: React.FC<Props> = ({ searchParams }) => { date_of_publication_datetime={tender.date_of_publication_datetime} date_of_offer_datetime={tender.date_of_offer_datetime} current_timestamp={tender.current_timestamp} - plan_summ={tender.plan_summ} + plan_summ_decimal={tender.plan_summ_decimal} + address_of_organization={tender.address_of_organization} /> ))} <Pagination