feat: Add online user guide with screenshots (#203) #204
@@ -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