Compare commits

..

No commits in common. "8c64cacaaac9432f0908ccabd0e804a6e8134413" and "0344b6a6fc98fc5e4c42548edbc22e42d8254a72" have entirely different histories.

2 changed files with 30 additions and 44 deletions

View File

@ -1,21 +1,6 @@
"use client";
import React, { useEffect, useState } from "react";
import Image from "next/image";
import { useLatestPropertyQuery } from "../../services/hooks/property";
export default function Footer() {
const { data, _fetch } = useLatestPropertyQuery();
const [isDataFetched, setIsDataFetched] = useState(false);
useEffect(() => {
if (!isDataFetched) {
_fetch();
setIsDataFetched(true);
}
}, [isDataFetched, _fetch]);
const latestProperties = data ? data.slice(0, 2) : [];
return (
<>
<section className="section section-md bg-colorFooter context-dark">
@ -25,34 +10,36 @@ export default function Footer() {
<h3 className="heading-square font-weight-sbold" data-item=".heading-square-item">
<span className="heading-square-item"></span>Latest Properties
</h3>
{latestProperties && latestProperties.length > 0 ? (
latestProperties.map((property, index) => (
<a key={index} className="post-minimal" href={`single-property/${property.slug}`}>
<a className="post-minimal" href="single-property.html">
<div className="post-minimal-image">
<Image
src={
property.images && property.images.length > 0
? property.images[0].url
: "/images/featured-properties-17-480x287.jpg"
}
alt={property.title}
width={161}
height={136}
/>
<Image src="/images/featured-properties-17-480x287.jpg" alt="" width="161" height="136" />
</div>
<div className="post-minimal-body">
<div className="post-minimal-title">
<span className="text-colorFooterText! hover:text-colorFooterTextHover!">{property.title}</span>
<span className="text-colorFooterText! hover:text-colorFooterTextHover!">
Retail Store Southwest 186th Street
</span>
</div>
<div className="post-minimal-text">
<span>From ${property.price}/month</span>
<span>From $120/month</span>
</div>
</div>
</a>
<a className="post-minimal" href="single-property.html">
<div className="post-minimal-image">
<Image src="/images/featured-properties-17-480x287.jpg" alt="" width="161" height="136" />
</div>
<div className="post-minimal-body">
<div className="post-minimal-title">
<span className="text-colorFooterText! hover:text-colorFooterTextHover!">
Apartment Building with Subunits
</span>
</div>
<div className="post-minimal-text">
<span>From $120/month</span>
</div>
</div>
</a>
))
) : (
<div>Data Not Available</div>
)}
</div>
<div className="col-md-6 col-lg-4 col-xl-3 col-bordered">
<h3 className="heading-square font-weight-sbold" data-item=".heading-square-item">

View File

@ -1,4 +1,3 @@
"use client";
import { CardPropertyData } from "@/schema/property";
import { useState } from "react";
import { fetchLatestPropertyREST } from "../rest/property";