diff --git a/src/App.js b/src/App.js index 74cf227..921475b 100644 --- a/src/App.js +++ b/src/App.js @@ -24,8 +24,19 @@ function HomePage({ setShowedModal, productSectionRef, courseSectionRef, + scrollToProduct, + scrollToCourse, setWillDo }) { + + useEffect(() => { + const params = new URLSearchParams(window.location.search); + const tab = params.get('tab'); + + if(tab === 'products') scrollToProduct(); + if(tab === 'academy') scrollToCourse(); + }, [productSectionRef, courseSectionRef]); + return ( <> @@ -46,6 +57,7 @@ function HomePage({ /> +