From 8c6a5d93b92d14c41cf2c7debb6645658ff59486 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 10 Sep 2023 17:40:43 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=92=BB=20Added=20Pro?= =?UTF-8?q?pertyCardH=20component=20=F0=9F=9A=80=20Initial=20implementatio?= =?UTF-8?q?n=20of=20PropertyCardH=20=F0=9F=8E=A8=20Improved=20code=20reada?= =?UTF-8?q?bility=20=F0=9F=94=A7=20Fixed=20minor=20bugs=20in=20PropertyCar?= =?UTF-8?q?dH=20=F0=9F=93=9D=20Updated=20comments=20and=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PropertyCardH.tsx | 148 +++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 src/components/PropertyCardH.tsx diff --git a/src/components/PropertyCardH.tsx b/src/components/PropertyCardH.tsx new file mode 100644 index 0000000..dc26485 --- /dev/null +++ b/src/components/PropertyCardH.tsx @@ -0,0 +1,148 @@ +import React, { FC } from "react"; +import GallerySlider from "@/components/GallerySlider"; +import { DEMO_STAY_LISTINGS } from "@/data/listings"; +import StartRating from "@/components/StartRating"; +import BtnLikeIcon from "@/components/BtnLikeIcon"; +import SaleOffBadge from "@/components/SaleOffBadge"; +import Badge from "@/shared/Badge"; +import { StayDataType } from "@/data/types"; +import Link from "next/link"; + +export interface PropertyCardHProps { + className?: string; + data?: StayDataType; +} + +const DEMO_DATA = DEMO_STAY_LISTINGS[0]; + +const PropertyCardH: FC = ({ + className = "", + data = DEMO_DATA, +}) => { + const { + galleryImgs, + title, + href, + like, + saleOff, + isAds, + price, + reviewStart, + reviewCount, + id, + } = data; + + const renderSliderGallery = () => { + return ( +
+ + + {saleOff && ( + + )} +
+ ); + }; + + const renderTienIch = () => { + return ( +
+
+ + + + + 6 beds + +
+ + {/* ---- */} +
+ + + + + 3 baths + +
+ + {/* ---- */} +
+ + + + + 1200 Sq. Fit + +
+
+ ); + }; + + const renderContent = () => { + return ( +
+
+
+ + + 4 Network +
+ } + /> + + + Family +
+ } + color="yellow" + /> +
+
+ {isAds && } +

+ {title} +

+
+ {renderTienIch()} +
+
+ + + {`${price},000`} + +
+ + + ); + }; + + return ( +
+ +
+ {renderSliderGallery()} + {renderContent()} +
+ +
+ ); +}; + +export default PropertyCardH;