From d4891100bb8817070f024ce82e2412b7756e8b92 Mon Sep 17 00:00:00 2001 From: John Doe Date: Sun, 10 Sep 2023 17:27:46 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Implemented=20StayCardH?= =?UTF-8?q?=20component=20=F0=9F=96=BC=EF=B8=8F=20Added=20image=20slider?= =?UTF-8?q?=20functionality=20=F0=9F=93=84=20Rendered=20property=20details?= =?UTF-8?q?=20=E2=AD=90=20Added=20star=20ratings=20and=20pricing=20?= =?UTF-8?q?=F0=9F=94=97=20Linked=20StayCardH=20to=20the=20main=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StayCardH.tsx | 147 +++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 src/components/StayCardH.tsx diff --git a/src/components/StayCardH.tsx b/src/components/StayCardH.tsx new file mode 100644 index 0000000..ce31758 --- /dev/null +++ b/src/components/StayCardH.tsx @@ -0,0 +1,147 @@ +import React, { FC } from "react"; +import GallerySlider from "@/components/GallerySlider"; +import { DEMO_STAY_LISTINGS } from "@/data/listings"; +import { StayDataType } from "@/data/types"; +import StartRating from "@/components/StartRating"; +import BtnLikeIcon from "@/components/BtnLikeIcon"; +import SaleOffBadge from "@/components/SaleOffBadge"; +import Badge from "@/shared/Badge"; +import Link from "next/link"; + +export interface StayCardHProps { + className?: string; + data?: StayDataType; +} + +const DEMO_DATA = DEMO_STAY_LISTINGS[0]; + +const StayCardH: FC = ({ + className = "", + data = DEMO_DATA, +}) => { + const { + galleryImgs, + listingCategory, + address, + title, + href, + like, + saleOff, + isAds, + price, + reviewStart, + reviewCount, + id, + } = data; + + const renderSliderGallery = () => { + return ( +
+ + + {saleOff && } +
+ ); + }; + + const renderTienIch = () => { + return ( +
+
+
+ + + 6 guests + +
+
+ + + 6 beds + +
+
+
+
+ + + 3 baths + +
+
+ + + No smoking + +
+
+
+
+ + + 6 bedrooms + +
+
+ + + Wifi + +
+
+
+ ); + }; + + const renderContent = () => { + return ( +
+
+
+ + {listingCategory.name} in {address} + +
+
+ {isAds && } +

+ {title} +

+
+
+
+ {renderTienIch()} +
+
+ + + {price} + {` `} + + /night + + +
+
+ ); + }; + + return ( +
+ +
+ {renderSliderGallery()} + {renderContent()} +
+
+ ); +}; + +export default StayCardH;