From 9737340da7b7fe400be3bb1a8d066ac6ace7dfa4 Mon Sep 17 00:00:00 2001 From: zojgame Date: Thu, 27 Jun 2024 11:02:22 +0500 Subject: [PATCH] apartment page desc --- .../StudioDescriptionSection.tsx | 92 ++++++++++++++++--- client/src/consts/initialMasterplanFilters.ts | 7 +- client/src/main.tsx | 2 +- .../{SearchApartment.tsx => Apartment.tsx} | 8 +- 4 files changed, 92 insertions(+), 17 deletions(-) rename client/src/pages/{SearchApartment.tsx => Apartment.tsx} (95%) diff --git a/client/src/components/apartmentPage/StudioDescriptionSection.tsx b/client/src/components/apartmentPage/StudioDescriptionSection.tsx index 079e26c..04a4f37 100644 --- a/client/src/components/apartmentPage/StudioDescriptionSection.tsx +++ b/client/src/components/apartmentPage/StudioDescriptionSection.tsx @@ -1,32 +1,100 @@ // import { formatNumber } from "../../calc/formatNumber"; +import { IAparmentRes } from "../../types/apartmentsRes"; -const StudioDescriptionSection = () => { +interface IApartmentDesc { + title: string; + subTitle?: string; + firstParagraph: string; + secondParagraph: string; + id: string; + totalArea: string; + cost: string; + apartmentType: string; +} + +const apartmentDescriptions: IApartmentDesc[] = [ + { + title: "Studio Flex", + subTitle: "Live in the future, today.", + firstParagraph: + "Live in the future, today. In Studio Flex explore the ORI Cloud Bed, optimizing your living space with functionality and smart living.", + secondParagraph: + "Every inch is designed to provide more space for comfort and convenience. This feature increase your unit size by 33%", + id: "1", + totalArea: "Up to 365,54 Sqft", + cost: "Unavailiable", + apartmentType: "Studio Flex", + }, + { + title: "Studio Squared", + firstParagraph: + "In Studio experience the Flexibed, a smart innovation for modern living", + secondParagraph: + "When folded, it unveils a spacious living room creating a cohesive space that blends both style and functionality.", + id: "2", + totalArea: "Up to 416,13 Sqft", + cost: "Unavailiable", + apartmentType: "Studio Squared", + }, + { + title: "1 Bedroom", + firstParagraph: + "In 1 Bedroom double up your space with next generation features that enhance smart living.", + secondParagraph: + "With pocket walls that disappear and a Flexibed that seamlessly converts, you can transform your living room into an extra bedroom, anytime you want!", + id: "3", + totalArea: "Up to 770,05 Sqft", + cost: "Unavailiable", + apartmentType: "1 BR Squared", + }, + { + title: "2 Bedroom", + firstParagraph: + "In 2 Bedroom discover extra functionality with added space and maximum value.", + secondParagraph: + "Whether you want to add a multipurpose spare room or double up your living space as a bedroom - every inch of space feels larger and works exactly how you want.", + id: "4", + totalArea: "Up to 1057,55 Sqft", + cost: "Unavailiable", + apartmentType: "2 BR Squared", + }, +]; + +interface StudioDescriptionSectionProps { + apartment: IAparmentRes; +} + +const StudioDescriptionSection = ({ + apartment, +}: StudioDescriptionSectionProps) => { + const apartmentDesc = apartmentDescriptions.find( + (aprt) => aprt.apartmentType === apartment.Unit_Type + ); return (

- Studio flex + {apartmentDesc?.title}

-

- Live in the future, today. -

+ {apartmentDesc?.subTitle && ( +

+ {apartmentDesc.subTitle} +

+ )}

- Live in the future, today. In Studio Flex explore the ORI Cloud - Bed, optimizing your living space with functionality and smart - living. + {apartmentDesc?.firstParagraph}

- Every inch is designed to provide more space for comfort and - convenience. This feature increase your unit size by 33% + {apartmentDesc?.secondParagraph}

-

Up to 365,54 Sqft

+

{apartmentDesc?.totalArea}

- Unvailiable + {apartmentDesc?.cost}

{/*

from AED {formatNumber(1668888, ",", 3, 1)} diff --git a/client/src/consts/initialMasterplanFilters.ts b/client/src/consts/initialMasterplanFilters.ts index 64309d1..0a88901 100644 --- a/client/src/consts/initialMasterplanFilters.ts +++ b/client/src/consts/initialMasterplanFilters.ts @@ -41,7 +41,12 @@ const initialAparmentTypeCheckboxes: ICheckbox[] = [ selected: false, value: "Studio Flex", }, - { title: "Studio", id: "2", selected: false, value: "Studio Squared" }, + { + title: "Studio Squared", + id: "2", + selected: false, + value: "Studio Squared", + }, { title: "1 Bedroom", id: "3", selected: false, value: "1 BR Squared" }, { title: "2 Bedroom", id: "4", selected: false, value: "2 BR Squared" }, ]; diff --git a/client/src/main.tsx b/client/src/main.tsx index c12cedc..75947e2 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -7,7 +7,7 @@ import "./index.css"; import Complex from "./pages/Complex"; import ComplexWing from "./pages/ComplexWing"; import Search from "./pages/Search"; -import ApartmentPage from "./pages/SearchApartment"; +import ApartmentPage from "./pages/Apartment"; import Favorites from "./pages/Favorites"; import VirtualTour from "./pages/VirtualTour"; import AboutComplex from "./pages/AboutComplex"; diff --git a/client/src/pages/SearchApartment.tsx b/client/src/pages/Apartment.tsx similarity index 95% rename from client/src/pages/SearchApartment.tsx rename to client/src/pages/Apartment.tsx index 3bfba75..78ceec0 100644 --- a/client/src/pages/SearchApartment.tsx +++ b/client/src/pages/Apartment.tsx @@ -91,9 +91,11 @@ const ApartmentPage = () => {

)} -
- -
+ {currentApartment && ( +
+ +
+ )} {/*
*/}