This commit is contained in:
parent
5cd544147a
commit
b9538f8855
@ -1,21 +1,39 @@
|
|||||||
|
import { useEffect } from "react";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
|
||||||
import Navbar from "@/components/Navbar";
|
|
||||||
import Hero from "@/components/Hero";
|
import Hero from "@/components/Hero";
|
||||||
import NewsSection from "@/components/NewsSection";
|
import NewsSection from "@/components/NewsSection";
|
||||||
import TeamSection from "@/components/TeamSection";
|
import TeamSection from "@/components/TeamSection";
|
||||||
import GallerySection from "@/components/GallerySection";
|
import GallerySection from "@/components/GallerySection";
|
||||||
import AboutSection from "@/components/AboutSection";
|
import AboutSection from "@/components/AboutSection";
|
||||||
import ContactSection from "@/components/ContactSection";
|
import ContactSection from "@/components/ContactSection";
|
||||||
import Footer from "@/components/Footer";
|
|
||||||
|
|
||||||
const Index = () => {
|
const Index = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const scrollToId = location.state?.scrollTo;
|
||||||
|
if (scrollToId) {
|
||||||
|
const element = document.getElementById(scrollToId);
|
||||||
|
if (element) {
|
||||||
|
element.scrollIntoView({ behavior: "smooth" });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [location]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-white">
|
<div className="min-h-screen bg-white">
|
||||||
|
<div id="top" />
|
||||||
<Hero />
|
<Hero />
|
||||||
|
<div id="news" />
|
||||||
<NewsSection />
|
<NewsSection />
|
||||||
|
<div id="team" />
|
||||||
<TeamSection />
|
<TeamSection />
|
||||||
|
<div id="gallery" />
|
||||||
<GallerySection />
|
<GallerySection />
|
||||||
|
<div id="about" />
|
||||||
<AboutSection />
|
<AboutSection />
|
||||||
|
<div id="contact" />
|
||||||
<ContactSection />
|
<ContactSection />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user