Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solved #20 i.e contact link is now working from other than homepage #21

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

thecodephilic-guy
Copy link
Contributor

  • Added useEffect hook to handle scrolling after navigation
  • Modified the handleNavigation function to include the hash in the URL when navigating
  • The useEffect hook now monitors path changes and handles scrolling when there's a hash in the URL

Fixed #20

Copy link

netlify bot commented Nov 12, 2024

Deploy Preview for landing-ohc ready!

Name Link
🔨 Latest commit 848b5ee
🔍 Latest deploy log https://app.netlify.com/sites/landing-ohc/deploys/67530112b007f80008f1c96a
😎 Deploy Preview https://deploy-preview-21--landing-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@thecodephilic-guy
Copy link
Contributor Author

Wait it was working fine on my localhost but I checked it just now in deployed preview link. It is not working. Can you look into it? I mean I am not getting it why it happended.

@shivankacker
Copy link
Member

@thecodephilic-guy probably because path gets resolved before the elements get painted due to longer latency... just a guess. You can debug by faking your network latency from the browser debug tools

@shivankacker
Copy link
Member

@thecodephilic-guy is this PR complete? Doesn't seem to work for me.

Comment on lines 36 to 41
const observer = new MutationObserver(() => {
handleScrollToHash();
observer.disconnect(); // Disconnect after one scroll to prevent repeated triggers
});

observer.observe(document.body, { attributes: true, subtree: true });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bit overkill for a small issue. Let's stick to just taking the user to /#contact without the scroll behaviour.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah actually it is and I have rolled my to previous one. But I am still struggling with the problem that it is not taking to the /#contact when user is on supporters page or may be care page. I tried faking the network speed during development it worked there but only for localhost. I need some more time to go to the core of the problem. I have the intuation it is just a minor one but I am not able to get it.

@thecodephilic-guy
Copy link
Contributor Author

It still did not work. Right now the code is in it's simplest form for this footer compoent.

@shivankacker
Copy link
Member

shivankacker commented Nov 20, 2024

@thecodephilic-guy maybe instead of routing through the router.push method just use a <Link/> element directly?

@thecodephilic-guy
Copy link
Contributor Author

@thecodephilic-guy maybe instead of routing through the router.push method just use a <Link/> element directly?

Tried doing everything, I need assistance to figure out what is causing the bug. May I?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contact link does not work properly in the footer
2 participants