favorite page
This commit is contained in:
@@ -4,21 +4,28 @@ import { apartmentsWithoutVirtualTour } from "../../../consts/apartmentsWithoutV
|
||||
|
||||
interface ApartmentDescriptionProps {
|
||||
isVisible: boolean;
|
||||
is3DTourAvailable: boolean;
|
||||
descRef: React.LegacyRef<HTMLDivElement>;
|
||||
hoveredApartment: IAparmentRes | null;
|
||||
apartmentDataType: string | null;
|
||||
}
|
||||
|
||||
const ApartmentDescription = ({
|
||||
isVisible,
|
||||
is3DTourAvailable,
|
||||
descRef,
|
||||
hoveredApartment,
|
||||
apartmentDataType,
|
||||
}: ApartmentDescriptionProps) => {
|
||||
const wing =
|
||||
hoveredApartment && hoveredApartment.Unit_No.split("-")[0] === "E"
|
||||
? "East Wing"
|
||||
: "West Wing";
|
||||
const isVirtualTourAvailiable =
|
||||
hoveredApartment &&
|
||||
!apartmentsWithoutVirtualTour.some(
|
||||
(aprt) =>
|
||||
aprt.type === hoveredApartment.Unit_Type ||
|
||||
aprt.type === apartmentDataType
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -49,13 +56,9 @@ const ApartmentDescription = ({
|
||||
{/* <p className="font-semibold text-[#00BED7] text-subheadline-s">
|
||||
AED 1,668,888
|
||||
</p> */}
|
||||
{!apartmentsWithoutVirtualTour.some(
|
||||
(aprt) => aprt.type === hoveredApartment.Unit_Type
|
||||
) && (
|
||||
{isVirtualTourAvailiable && (
|
||||
<div
|
||||
className={`bg-[#30B21614] text-[#30B216] px-2 py-[6px] flex gap-1 items-center rounded-lg ${
|
||||
is3DTourAvailable ? "opacity-100" : "opacity-0"
|
||||
}`}
|
||||
className={`bg-[#30B21614] text-[#30B216] px-2 py-[6px] flex gap-1 items-center rounded-lg opacity-100`}
|
||||
>
|
||||
<VirtualTourIcon />
|
||||
<p className="text-caption-m font-semibold text-[#30B216]">
|
||||
|
||||
@@ -33,7 +33,6 @@ const FloorSidebar = ({
|
||||
string | null
|
||||
>(null);
|
||||
const [apartments, setApartments] = useState<IAparmentRes[]>([]);
|
||||
const [is3DTourAvailable] = useState(true);
|
||||
const { setModal } = useModal();
|
||||
const descRef = useRef(null);
|
||||
|
||||
@@ -134,7 +133,7 @@ const FloorSidebar = ({
|
||||
hoveredApartment={hoveredApartment}
|
||||
descRef={descRef}
|
||||
isVisible={isDescVisible}
|
||||
is3DTourAvailable={is3DTourAvailable}
|
||||
apartmentDataType={hoveredApartmentType}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user