Skip to content

Commit

Permalink
fixed hero issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yaasiinaxmed committed Nov 16, 2023
1 parent 304f1e1 commit a654134
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/components/header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Header() {

const headerRef = useRef(null);
const menuRef = useRef(null);
const [menu, setMenu] = useState(true);
const [menu, setMenu] = useState(false);

// header sticky function
const stickyHeader = () => {
Expand Down
12 changes: 8 additions & 4 deletions src/components/homeContent/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import React from "react";
import { Link } from "react-router-dom";
import heroImg from "../../assets/hero.jpg";

function Hero() {
return (
<section className="w-full h-[70vh] bg-hero bg-cover bg-center bg-no-repeat">
<section
className="w-full h-[100vh] bg-cover bg-center bg-no-repeat"
style={{ backgroundImage: `url(${heroImg})` }}
>
<div className="container h-full flex items-center justify-center flex-col gap-2">
<h2 className="text text-2xl md:text-3xl !leading-[2rem] sm:!leading-[3rem] text-center text-white font-medium whitespace-normal">
Are you looking for a property <br className="hidden md:block"/> That perfectly matches your
requirements?
Are you looking for a property <br className="hidden md:block" /> That
perfectly matches your requirements?
</h2>
<p className="text-xl md:text-2xl text-center text-white font-normal ">
Discover it with ease!
</p>
<Link to="/Properties">
<button className="bg-white mt-2 text-primaryColor px-8 py-2 h-[44px] font-medium flex items-center justify-center rounded-3xl duration-100 hover:scale-110 ">
Explore Now
Explore Now
</button>
</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/profileContent/ProfileContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function ProfileContent() {
<button onClick={handleDeleteUser} className="mt-6 w-full bg-red-500 bg-opacity-90 hover:bg-opacity-100 px-4 py-3 text-sm flex items-center justify-center rounded-xl text-white duration-100 ">
Delete Account
</button>
<button onClick={handleLogout} className="mt-3 w-full bg-red-500 bg-opacity-10 border-2 border-red-300 text-red-500 hover:bg-opacity-20 px-4 py-3 text-sm flex items-center justify-center rounded-xl duration-100 ">
<button onClick={handleLogout} className="mt-3 w-full bg-red-500 bg-opacity-10 border-[2px] border-red-300 text-red-500 hover:bg-opacity-20 px-4 py-3 text-sm flex items-center justify-center rounded-xl duration-100 ">
Logout
</button>
</div>
Expand Down
30 changes: 17 additions & 13 deletions src/pages/properties/Properties.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React, { useState } from "react";
import PropertyCard from "../../components/PropertyCard";
import SearchBar from "../../components/SearchBar";
import { useGetPropertiesQuery } from "../../store/api/PropertySlice";
import searchImg from "../../assets/search.png"
import searchImg from "../../assets/search.png";
import heroImg from "../../assets/hero.jpg";

function Properties() {
const {data: properties = [], isLoading} = useGetPropertiesQuery()
const { data: properties = [], isLoading } = useGetPropertiesQuery();
const [filter, setFilter] = useState("");
const searchData = properties.filter(
(property) =>
Expand All @@ -18,22 +19,25 @@ function Properties() {
return (
<div className="w-full">
{/* cover */}
<div className="w-full h-[200px] bg-hero bg-cover bg-center bg-no-repeat flex items-center justify-center">
<div
className="w-full h-[200px] bg-cover bg-center bg-no-repeat flex items-center justify-center"
style={{ backgroundImage: `url(${heroImg})` }}
>
<SearchBar filter={filter} setFilter={setFilter} />
</div>
{/* Properties */}
<div className="container pb-12 flex items-center justify-center flex-wrap gap-6 mt-8">
{isLoading ? (
<div className="flex gap-2 items-center justify-center ">
<span className="w-6 h-6 rounded-full border-2 border-primaryColor border-l-white animate-spin"></span>
Loading...
</div>
) : (
<>
{isLoading ? (
<div className="flex gap-2 items-center justify-center ">
<span className="w-6 h-6 rounded-full border-2 border-primaryColor border-l-white animate-spin"></span>
Loading...
</div>
) : (
<>
{searchData.length === 0 ? (
<section className="py-[3rem] flex flex-col items-center justify-center">
<figure className="w-[20rem]">
<img src={searchImg} alt="" className="w-full"/>
<img src={searchImg} alt="" className="w-full" />
</figure>
<h1>No Results Found</h1>
</section>
Expand All @@ -42,8 +46,8 @@ function Properties() {
<PropertyCard property={property} key={property._id} />
))
)}
</>
)}
</>
)}
</div>
</div>
);
Expand Down
3 changes: 0 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ export default {
colors: {
primaryColor: "#1E88E5",
HeadingColor: "#222222"
},
backgroundImage: {
"hero": `url("./src/assets/hero.jpg")`
}
},
},
Expand Down

0 comments on commit a654134

Please sign in to comment.