1
0
Fork 0

This autoAnimate is SO GOOD

This commit is contained in:
Lim Chee Aun 2023-10-30 09:24:36 +08:00
parent 3092a8bba1
commit 3760b52860

View file

@ -1,5 +1,6 @@
import './search.css';
import { useAutoAnimate } from '@formkit/auto-animate/preact';
import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks';
import { useHotkeys } from 'react-hotkeys-hook';
import { InView } from 'react-intersection-observer';
@ -145,6 +146,8 @@ function Search(props) {
},
);
const [filterBarParent] = useAutoAnimate();
return (
<div id="search-page" class="deck-container" ref={scrollableRef}>
<div class="timeline-deck deck">
@ -159,7 +162,10 @@ function Search(props) {
</header>
<main>
{!!q && (
<div class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}>
<div
ref={filterBarParent}
class={`filter-bar ${uiState === 'loading' ? 'loading' : ''}`}
>
{!!type && (
<Link to={`/search${q ? `?q=${encodeURIComponent(q)}` : ''}`}>
All