From 083ce21478f35dd065de320df259fb0154b0d24f Mon Sep 17 00:00:00 2001 From: jordanjoelson Date: Tue, 3 Dec 2024 14:31:48 -0600 Subject: [PATCH] update url right away --- src/components/SearchBar.tsx | 114 +++-------------------------------- 1 file changed, 10 insertions(+), 104 deletions(-) diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index 4cb8d44..80bf583 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -9,12 +9,8 @@ import { } from 'react'; import { SearchIcon } from '../icons/Icons'; import { useRouter } from 'next/navigation'; -import type { - SelectClub as Club, - SelectUserMetadata, -} from '@src/server/db/models'; -import { api } from '@src/trpc/react'; import type { SelectEvent as Event } from '@src/server/db/models'; +import { api } from '@src/trpc/react'; type SearchElement = { id: string; @@ -26,7 +22,7 @@ type SearchBarProps = { setSearch: Dispatch>; searchResults?: Array; onClick?: (input: T) => void; - onKeyDown?: (e: KeyboardEvent) => void; // Add this line + onKeyDown?: (e: KeyboardEvent) => void; }; export const SearchBar = ({ @@ -35,7 +31,7 @@ export const SearchBar = ({ setSearch, searchResults, onClick, - onKeyDown, // Add this line + onKeyDown, }: SearchBarProps) => { const [input, setInput] = useState(value ?? ''); const [focused, setFocused] = useState(false); @@ -65,7 +61,7 @@ export const SearchBar = ({ className="h-10 w-full rounded-full border pl-10 pr-3 focus:outline-none" tabIndex={0} onChange={handleSearch} - onKeyDown={onKeyDown} // Add this line + onKeyDown={onKeyDown} onFocus={() => setFocused(true)} onBlur={() => setTimeout(() => setFocused(false), 300)} /> @@ -74,7 +70,7 @@ export const SearchBar = ({ {searchResults.map((item) => (