From 754ddeaa8d3e3e4f3efc93d5bb22c68c31bb5c36 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <ellie@elliehuxtable.com>
Date: Mon, 6 May 2024 08:11:47 +0100
Subject: feat(ui): scroll history infinitely (#1999)

* wip, history scrolls right!

* wip

* virtual scroll fucking worksssss

* paging works :)

* scroll search results now too
---
 ui/src/components/HistorySearch.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'ui/src/components/HistorySearch.tsx')

diff --git a/ui/src/components/HistorySearch.tsx b/ui/src/components/HistorySearch.tsx
index 08bed2a8..b3c8492a 100644
--- a/ui/src/components/HistorySearch.tsx
+++ b/ui/src/components/HistorySearch.tsx
@@ -3,12 +3,12 @@ import { ArrowPathIcon } from "@heroicons/react/24/outline";
 import { MagnifyingGlassIcon } from "@heroicons/react/20/solid";
 
 interface HistorySearchProps {
-  refresh: (query: string) => void;
+  query: string;
+  refresh: () => void;
+  setQuery: (query: string) => void;
 }
 
 export default function HistorySearch(props: HistorySearchProps) {
-  let [searchQuery, setSearchQuery] = useState("");
-
   return (
     <div className="flex flex-1 gap-x-4 self-stretch lg:gap-x-6">
       <form
@@ -35,8 +35,8 @@ export default function HistorySearch(props: HistorySearchProps) {
           type="search"
           name="search"
           onChange={(query) => {
-            setSearchQuery(query.target.value);
-            props.refresh(query.target.value);
+            props.setQuery(query.target.value);
+            props.refresh();
           }}
         />
       </form>
@@ -45,7 +45,7 @@ export default function HistorySearch(props: HistorySearchProps) {
           type="button"
           className="-m-2.5 p-2.5 text-gray-400 hover:text-gray-500"
           onClick={() => {
-            props.refresh(searchQuery);
+            props.refresh();
           }}
         >
           <ArrowPathIcon className="h-6 w-6" aria-hidden="true" />
-- 
cgit v1.3.1

