diff --git a/app/page.js b/app/page.js index 332a42c..4959bcb 100644 --- a/app/page.js +++ b/app/page.js @@ -1,4 +1,5 @@ -import React from 'react' +"use client" +// import React from 'react' import Navbar from '@/components/Navbar' import Hero from '@/components/Hero' import Grid from '@/components/Grid' @@ -8,8 +9,10 @@ import Faq from '@/components/Faq' import Newsletter from '@/components/Newsletter' import About from '@/components/About' import Footer from '@/components/Footer' +import React, { useRef } from 'react'; const page = () => { + const newsletterRef = useRef(); return (
@@ -20,7 +23,9 @@ const page = () => { {/* */} - +
+ +
diff --git a/components/About.jsx b/components/About.jsx index 9d307bd..028424d 100644 --- a/components/About.jsx +++ b/components/About.jsx @@ -1,4 +1,6 @@ import React from 'react' +// import { Link } from 'react-scroll' +import Link from 'next/link'; const About = () => { return ( @@ -23,7 +25,7 @@ const About = () => { Home - + About @@ -32,9 +34,9 @@ const About = () => { Docs - + Contact - +
{/*
diff --git a/components/Hero.jsx b/components/Hero.jsx index 8c600b6..9a46304 100644 --- a/components/Hero.jsx +++ b/components/Hero.jsx @@ -29,7 +29,7 @@ const Hero = () => {
Xmigrate(pronounced as cross-migrate) is an opensource tool for migrating your VM'sfrom anywhere to cloud and cloud to anywhere seamlessly.
- Start Migrate + Start Migrate
View Demo @@ -63,7 +63,7 @@ const Hero = () => {
We are rigourosly testing and rolling out updates to our Xmigrate tool every week. Xmigrate team invite everyone to give this tool a try and give feedback.
-
Empower your cloud migration
+
Empower your cloud migration
Xmigrate team invite everyone to give this tool a try and give feedback.
//
diff --git a/components/Navbar.jsx b/components/Navbar.jsx index 88d0211..906c461 100644 --- a/components/Navbar.jsx +++ b/components/Navbar.jsx @@ -1,10 +1,34 @@ -import React from 'react' +// import React from 'react' +import React, { useRef, useEffect } from 'react'; import Image from 'next/image' +import Link from 'next/link'; const Navbar = () => { + const newsletterRef = useRef(); + + useEffect(() => { + const handleScrollToNewsletter = () => { + if (newsletterRef.current) { + newsletterRef.current.scrollIntoView({ behavior: 'smooth' }); + } + }; + + // Attach the event listener for the Contact link + const contactLink = document.getElementById('contact-link'); + if (contactLink) { + contactLink.addEventListener('click', handleScrollToNewsletter); + } + + // Remove the event listener when the component is unmounted + return () => { + if (contactLink) { + contactLink.removeEventListener('click', handleScrollToNewsletter); + } + }; + }, []); return (