refactor: use scrollIntoView instead of link

This commit is contained in:
MAZE 2023-11-05 15:02:53 +03:30
parent 5cfb9a8293
commit 4d2645f06c
2 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,12 @@ import { Container } from '@/components/container';
import styles from './ready.module.css';
export function Ready() {
const handleClick = () => {
const app = document.getElementById('app');
app?.scrollIntoView(true);
};
return (
<div className={styles.ready}>
<Container>
@ -18,9 +24,9 @@ export function Ready() {
<h2 className={styles.title}>Are you ready?</h2>
<p className={styles.desc}>Create your calm oasis in seconds!</p>
<a className={styles.button} href="#app">
<button className={styles.button} onClick={handleClick}>
Use Moodist
</a>
</button>
</div>
</Container>
</div>

View File

@ -12,6 +12,6 @@ import { AboutSection, WhySection, ReadySection } from '@/components/sections';
<App client:load />
<AboutSection />
<WhySection />
<ReadySection />
<ReadySection client:load />
<Footer />
</Layout>