-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adds search wip * correctly types the onChange for the input * cleans up unsed imports * naming * Feature/public profile (#384) * Add some stuff * Add public profile * Add ens * Get build to pass * Update apps/hub-app/src/pages/PublicProfilePage.tsx Co-authored-by: Rowdy <[email protected]> Co-authored-by: Sam Kuhlmann <[email protected]> Co-authored-by: Rowdy <[email protected]> * fixing doc display name from <[object Object]> to displayName (#402) Co-authored-by: Sam Kuhlmann <[email protected]> * conflicts * correctly types the onChange for the input * cleans up unsed imports * naming * fix build error Co-authored-by: Alexander Keating <[email protected]> Co-authored-by: Rowdy <[email protected]> Co-authored-by: Brian Rossetti <[email protected]>
- Loading branch information
1 parent
5a64ccc
commit 2c80dca
Showing
12 changed files
with
146 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { ChangeEvent } from 'react'; | ||
import styled from 'styled-components'; | ||
import { indigoDark } from '@radix-ui/colors'; | ||
import { BiSearch } from 'react-icons/bi'; | ||
import { Input } from '@daohaus/ui'; | ||
|
||
const StyledInput = styled(Input)` | ||
background: ${indigoDark.indigo3}; | ||
color: ${indigoDark.indigo11}; | ||
::placeholder { | ||
color: ${indigoDark.indigo11}; | ||
} | ||
:focus { | ||
background: ${indigoDark.indigo3}; | ||
color: ${indigoDark.indigo11}; | ||
} | ||
`; | ||
|
||
const IconSearch = styled(BiSearch)` | ||
fill: ${indigoDark.indigo11}; | ||
:hover { | ||
fill: ${indigoDark.indigo11}; | ||
} | ||
`; | ||
|
||
type SearchInputProps = { | ||
searchTerm: string; | ||
setSearchTerm: (event: ChangeEvent<HTMLInputElement>) => void; | ||
}; | ||
|
||
const SearchInput = ({ searchTerm, setSearchTerm }: SearchInputProps) => { | ||
return ( | ||
<StyledInput | ||
icon={IconSearch} | ||
id="table-search" | ||
placeholder="Search Daos" | ||
onChange={setSearchTerm} | ||
defaultValue={searchTerm} | ||
/> | ||
); | ||
}; | ||
|
||
export default SearchInput; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
function useDebounce<T>(value: T, delay?: number): T { | ||
const [debouncedValue, setDebouncedValue] = useState<T>(value); | ||
|
||
useEffect(() => { | ||
const timer = setTimeout(() => setDebouncedValue(value), delay || 500); | ||
|
||
return () => { | ||
clearTimeout(timer); | ||
}; | ||
}, [value, delay]); | ||
|
||
return debouncedValue; | ||
} | ||
|
||
export default useDebounce; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters