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 Image from "next/image";
import { useLatestPropertyQuery } from "../../services/hooks/property";
export default function Footer() { 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 ( return (
<> <>
<section className="section section-md bg-colorFooter context-dark"> <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"> <h3 className="heading-square font-weight-sbold" data-item=".heading-square-item">
<span className="heading-square-item"></span>Latest Properties <span className="heading-square-item"></span>Latest Properties
</h3> </h3>
{latestProperties && latestProperties.length > 0 ? ( <a className="post-minimal" href="single-property.html">
latestProperties.map((property, index) => ( <div className="post-minimal-image">
<a key={index} className="post-minimal" href={`single-property/${property.slug}`}> <Image src="/images/featured-properties-17-480x287.jpg" alt="" width="161" height="136" />
<div className="post-minimal-image"> </div>
<Image <div className="post-minimal-body">
src={ <div className="post-minimal-title">
property.images && property.images.length > 0 <span className="text-colorFooterText! hover:text-colorFooterTextHover!">
? property.images[0].url Retail Store Southwest 186th Street
: "/images/featured-properties-17-480x287.jpg" </span>
} </div>
alt={property.title} <div className="post-minimal-text">
width={161} <span>From $120/month</span>
height={136} </div>
/> </div>
</div> </a>
<div className="post-minimal-body"> <a className="post-minimal" href="single-property.html">
<div className="post-minimal-title"> <div className="post-minimal-image">
<span className="text-colorFooterText! hover:text-colorFooterTextHover!">{property.title}</span> <Image src="/images/featured-properties-17-480x287.jpg" alt="" width="161" height="136" />
</div> </div>
<div className="post-minimal-text"> <div className="post-minimal-body">
<span>From ${property.price}/month</span> <div className="post-minimal-title">
</div> <span className="text-colorFooterText! hover:text-colorFooterTextHover!">
</div> Apartment Building with Subunits
</a> </span>
)) </div>
) : ( <div className="post-minimal-text">
<div>Data Not Available</div> <span>From $120/month</span>
)} </div>
</div>
</a>
</div> </div>
<div className="col-md-6 col-lg-4 col-xl-3 col-bordered"> <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"> <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 { CardPropertyData } from "@/schema/property";
import { useState } from "react"; import { useState } from "react";
import { fetchLatestPropertyREST } from "../rest/property"; import { fetchLatestPropertyREST } from "../rest/property";