Skip to content

Commit

Permalink
fix: Update Home.tsx (#580)
Browse files Browse the repository at this point in the history
Update Home.tsx

clicking on get started button scrolls down to featured pet in home page
  • Loading branch information
SharavanMudaliar authored Sep 8, 2023
1 parent de26b25 commit 8b5ace1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ import "./home.css";
import load from "./loding.png";

export default function Home() {
const scrollToFeaturedPets = () => {
const featuredPetsSection = document.getElementById("featured-pets");
if (featuredPetsSection) {
featuredPetsSection.scrollIntoView({ behavior: "smooth" });
}
};
return (
<div>
<Hero className="home__background min-h-screen">
Expand All @@ -23,12 +29,17 @@ export default function Home() {
<h1 className="text-5xl font-bold font-amatic">Get a BFF</h1>
<h2 className="text-5xl font-bold font-amatic">Now and Forever </h2>

<Button color="primary" className="my-2">
<Button
color="primary"
className="my-2"
onClick={scrollToFeaturedPets}
>
Get Started
</Button>
</div>
</Hero.Content>
</Hero>
<div id="featured-pets"></div>
<LoadingPetCards />
</div>
);
Expand Down

0 comments on commit 8b5ace1

Please sign in to comment.