fix: links from homepage to guide not working
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 3m36s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 53s
Deploy to Staging / Verify Staging (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 8s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
All checks were successful
Deploy to Staging / Build Images (pull_request) Successful in 3m36s
Deploy to Staging / Deploy to Staging (pull_request) Successful in 53s
Deploy to Staging / Verify Staging (pull_request) Successful in 9s
Deploy to Staging / Notify Staging Ready (pull_request) Successful in 8s
Deploy to Staging / Notify Staging Failure (pull_request) Has been skipped
This commit is contained in:
@@ -35,6 +35,25 @@ export const GuidePage = () => {
|
||||
navigate('/signup');
|
||||
}, [navigate]);
|
||||
|
||||
// Scroll to hash target after lazy-loaded sections render
|
||||
useEffect(() => {
|
||||
const hash = window.location.hash.slice(1);
|
||||
if (!hash) return;
|
||||
|
||||
// Poll for the element since Suspense sections load asynchronously
|
||||
let attempts = 0;
|
||||
const interval = setInterval(() => {
|
||||
const target = document.getElementById(hash);
|
||||
if (target) {
|
||||
clearInterval(interval);
|
||||
target.scrollIntoView({ behavior: 'smooth' });
|
||||
}
|
||||
if (++attempts >= 20) clearInterval(interval);
|
||||
}, 100);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
// Track scroll position for nav background and active section
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
|
||||
Reference in New Issue
Block a user