Added state management
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
import { createViewportObserver } from '@solid-primitives/intersection-observer';
|
||||
|
||||
import { useStore } from '../../store/index';
|
||||
import styles from './Projects.module.css';
|
||||
|
||||
export default () => {
|
||||
const [, { setVisibleChapter }] = useStore();
|
||||
const [add] = createViewportObserver();
|
||||
|
||||
return (
|
||||
<div class={styles.Projects}>
|
||||
<div
|
||||
ref={el => {
|
||||
add(el, (event) => {
|
||||
console.log(event.isIntersecting);
|
||||
setVisibleChapter('projects');
|
||||
});
|
||||
}}
|
||||
class={styles.Projects}
|
||||
>
|
||||
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user