Adding Packages - downshift and recent searches and basic code

This commit is contained in:
Rupin Khandelwal 2022-08-31 22:04:45 -05:00
parent 386a47b73b
commit 04acffd668
2 changed files with 12 additions and 7 deletions

View file

@ -10,8 +10,10 @@ export type LibrarySearchBarProps = {
coordinator: SearchCoordinator
}
export function LibrarySearchBar(props: LibrarySearchBarProps): JSX.Element {
const [searchTerm, setSearchTerm] = useState('')
const [searchTerm, setSearchTerm] = useState('')
const [recentSearches, setRecentSearches] = useState(Array<any>([]))
return (
<>
@ -62,10 +64,10 @@ export function LibrarySearchBar(props: LibrarySearchBarProps): JSX.Element {
<Button
style="plainIcon"
onClick={(event) => {
// event.preventDefault()
// setSearchTerm('')
// props.applySearchQuery('')
// inputRef.current?.blur()
event.preventDefault()
setSearchTerm('')
//props.applySearchQuery('')
// inputRef.current?.blur()
}}
css={{
display: 'flex',
@ -85,8 +87,9 @@ export function LibrarySearchBar(props: LibrarySearchBarProps): JSX.Element {
<Button
style="ctaDarkYellow"
onClick={(event) => {
// event.preventDefault()
// setSearchTerm('')
event.preventDefault()
console.log(searchTerm)
setSearchTerm(searchTerm)
// props.applySearchQuery('')
// inputRef.current?.blur()
}}

View file

@ -32,6 +32,7 @@
"color2k": "^2.0.0",
"cookie": "^0.5.0",
"diff-match-patch": "^1.0.5",
"downshift": "^6.1.9",
"graphql-request": "^3.6.1",
"kbar": "^0.1.0-beta.35",
"nanoid": "^3.1.29",
@ -48,6 +49,7 @@
"react-super-responsive-table": "^5.2.1",
"react-topbar-progress-indicator": "^4.1.1",
"react-twitter-widgets": "^1.10.0",
"recent-searches": "^1.0.5",
"swr": "^1.0.1",
"uuid": "^8.3.2"
},