From 31f8844a61c02246c8829e642801079acb5a8b3c Mon Sep 17 00:00:00 2001 From: John Doe Date: Mon, 11 Sep 2023 17:07:47 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=20Added=20ExperiencesCardH=20compo?= =?UTF-8?q?nent.=20=F0=9F=9B=A0=20Implemented=20the=20gallery=20slider.=20?= =?UTF-8?q?=F0=9F=92=85=20Styled=20the=20ExperiencesCardH=20component.=20?= =?UTF-8?q?=F0=9F=93=84=20Updated=20README.md.=20=E2=9C=A8=20Added=20initi?= =?UTF-8?q?al=20data=20for=20ExperiencesCardH.=20=F0=9F=94=84=20Refactored?= =?UTF-8?q?=20ExperiencesCardH=20for=20better=20performance.=20?= =?UTF-8?q?=F0=9F=90=9B=20Fixed=20a=20bug=20in=20ExperiencesCardH.=20?= =?UTF-8?q?=F0=9F=93=9D=20Added=20comments=20for=20better=20code=20readabi?= =?UTF-8?q?lity.=20=F0=9F=93=A6=20Updated=20dependencies=20and=20packages.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ExperiencesCardH.tsx | 129 ++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 src/components/ExperiencesCardH.tsx diff --git a/src/components/ExperiencesCardH.tsx b/src/components/ExperiencesCardH.tsx new file mode 100644 index 0000000..4b4bbf1 --- /dev/null +++ b/src/components/ExperiencesCardH.tsx @@ -0,0 +1,129 @@ +import React, { FC } from "react"; +import GallerySlider from "@/components/GallerySlider"; +import { DEMO_EXPERIENCES_LISTINGS } from "@/data/listings"; +import { ExperiencesDataType } from "@/data/types"; +import StartRating from "@/components/StartRating"; +import BtnLikeIcon from "@/components/BtnLikeIcon"; +import SaleOffBadge from "@/components/SaleOffBadge"; +import Badge from "@/shared/Badge"; +import Avatar from "@/shared/Avatar"; +import Link from "next/link"; + +export interface ExperiencesCardHProps { + className?: string; + data?: ExperiencesDataType; +} + +const DEMO_DATA: ExperiencesDataType = DEMO_EXPERIENCES_LISTINGS[0]; + +const ExperiencesCardH: FC = ({ + className = "", + data = DEMO_DATA, +}) => { + const { + galleryImgs, + address, + title, + href, + like, + saleOff, + isAds, + price, + reviewStart, + reviewCount, + author, + id, + } = data; + + const renderSliderGallery = () => { + return ( +
+ + + {saleOff && } +
+ ); + }; + + const renderContent = () => { + return ( +
+
+
+ {isAds && } +

+ {title} +

+
+
+ + ยท +
+ + + + {address} +
+
+
+
+ + {`Making a cup of coffee in Vietnam is a whole process that you barely + have free time in the middle. But it's also not a really complicated + task to start the day with`} + +
+
+
+ + + 3 hours + +
+
+ + + Up to 6 people + +
+
+
+
+
+ + + Hosted by{" "} + {author.displayName} + +
+ + {price} + {` `} + + /person + + +
+
+ ); + }; + + return ( +
+ +
+ {renderSliderGallery()} + {renderContent()} +
+
+ ); +}; + +export default ExperiencesCardH;