refactor: implement smart navigation for "Get Mycelium Connector" button with smooth scroll utility

- Added smoothScrollToElement utility function in src/utils/scroll.ts with easeInOutQuad animation and configurable duration
- Changed Header and HeaderDark "Get Mycelium Connector" button from static /download link to onClick handler with conditional navigation
- Added handleGetConnectorClick function that scrolls to #download section when on /network page, otherwise navigates to /network
- Change
This commit is contained in:
2025-11-24 14:13:40 +01:00
parent a22a8ddcc9
commit 6b4c7b3329
6 changed files with 95 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
import { useId } from 'react'
import { Container } from '@/components/Container'
import { Button } from '@/components/Button'
import { smoothScrollToElement } from '@/utils/scroll'
import phoneFrame from '../../images/phoneframe.png'
import { H3, P
, Eyebrow } from "@/components/Texts";
@@ -93,7 +94,11 @@ export function Hero() {
Your Pod is your personal gateway to the network.
</P>
<div className="mt-8 flex flex-wrap gap-x-6 gap-y-4">
<Button to="/download" variant="solid" color="cyan">
<Button
variant="solid"
color="cyan"
onClick={() => smoothScrollToElement('download', 1200)}
>
Get Started
</Button>
<Button