forked from emre/www_projectmycelium_com
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user