From d7eb293e35135655dac4c6e7ea72f134d3f0de0f Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 17:04:14 +0300 Subject: [PATCH] Update SectionGridFeatureProperty component * Add gridClass prop to allow custom styling of the grid * Add headingIsCenter prop to allow centering the heading * Update enderCard function to use the data prop instead of stay * Add a loading prop to the ButtonPrimary component to show a loading indicator --- src/app/(home)/SectionGridFeatureProperty.tsx | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/app/(home)/SectionGridFeatureProperty.tsx diff --git a/src/app/(home)/SectionGridFeatureProperty.tsx b/src/app/(home)/SectionGridFeatureProperty.tsx new file mode 100644 index 0000000..e2f5abe --- /dev/null +++ b/src/app/(home)/SectionGridFeatureProperty.tsx @@ -0,0 +1,52 @@ +import React, { FC, ReactNode } from "react"; +import { DEMO_STAY_LISTINGS } from "@/data/listings"; +import { StayDataType } from "@/data/types"; +import ButtonPrimary from "@/shared/ButtonPrimary"; +import PropertyCardH from "@/components/PropertyCardH"; +import HeaderFilter from "@/components/HeaderFilter"; + +// OTHER DEMO WILL PASS PROPS +const DEMO_DATA: StayDataType[] = DEMO_STAY_LISTINGS.filter((_, i) => i < 8); +// +export interface SectionGridFeaturePropertyProps { + stayListings?: StayDataType[]; + gridClass?: string; + heading?: ReactNode; + subHeading?: ReactNode; + headingIsCenter?: boolean; + tabs?: string[]; +} + +const SectionGridFeatureProperty: FC = ({ + stayListings = DEMO_DATA, + gridClass = "", + heading = "Featured places to stay", + subHeading = "Popular places to stay that Chisfis recommends for you", + headingIsCenter, + tabs = ["New York", "Tokyo", "Paris", "London"], +}) => { + const renderCard = (stay: StayDataType, index: number) => { + return ; + }; + + return ( +
+ +
+ {stayListings.map(renderCard)} +
+
+ Show me more +
+
+ ); +}; + +export default SectionGridFeatureProperty;