diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-05-06 08:11:47 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-06 08:11:47 +0100 |
| commit | 754ddeaa8d3e3e4f3efc93d5bb22c68c31bb5c36 (patch) | |
| tree | f48fb912c2be2d08855e97ff24b6919a115c3c4f /ui/src/components/HistorySearch.tsx | |
| parent | chore(deps): bump serde_with from 3.7.0 to 3.8.1 (#2002) (diff) | |
| download | atuin-754ddeaa8d3e3e4f3efc93d5bb22c68c31bb5c36.zip | |
feat(ui): scroll history infinitely (#1999)
* wip, history scrolls right!
* wip
* virtual scroll fucking worksssss
* paging works :)
* scroll search results now too
Diffstat (limited to 'ui/src/components/HistorySearch.tsx')
| -rw-r--r-- | ui/src/components/HistorySearch.tsx | 12 |
1 files changed, 6 insertions, 6 deletions
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" /> |
