-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4262b33
commit 0398eb1
Showing
12 changed files
with
123 additions
and
238 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,22 @@ | ||
import { memo } from 'react' | ||
|
||
export interface DashboardBodyProps { | ||
borderless?: boolean | ||
children?: React.ReactNode | ||
} | ||
|
||
export const DashboardBody = memo<DashboardBodyProps>(({ children, borderless = false }) => { | ||
if (borderless) { | ||
} | ||
return ( | ||
<div className="bg-white dark:bg-black p-5 pt-0"> | ||
{borderless ? ( | ||
children | ||
) : ( | ||
<div className="border rounded-lg border-line-light dark:border-neutral-800 overflow-hidden"> | ||
{children} | ||
</div> | ||
)} | ||
</div> | ||
) | ||
}) |
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 was deleted.
Oops, something went wrong.
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,49 @@ | ||
import { useCallback, useState } from 'react' | ||
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline' | ||
|
||
export interface SearchBoxProps { | ||
onChange: (keyword: string) => void | ||
} | ||
|
||
export function SearchBox(props: SearchBoxProps) { | ||
const { onChange } = props | ||
const [keyword, setKeyword] = useState('') | ||
|
||
const onFocus = useCallback((e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => { | ||
e.target.select() | ||
}, []) | ||
|
||
const handleKeywordChange = useCallback( | ||
(e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => { | ||
const newKeyword = e.target.value | ||
setKeyword(newKeyword) | ||
onChange(newKeyword) // Invoke the onChange prop when the keyword changes | ||
}, | ||
[onChange], | ||
) | ||
|
||
return ( | ||
<div className="flex flex-1 gap-x-4 self-stretch lg:gap-x-6"> | ||
<label htmlFor="search-field" className="sr-only"> | ||
Search | ||
</label> | ||
<div className="relative w-full"> | ||
<MagnifyingGlassIcon | ||
className="pointer-events-none absolute inset-y-0 left-0 h-full w-5 text-black dark:text-white" | ||
aria-hidden="true" | ||
/> | ||
<input | ||
id="search-field" | ||
className="dark:bg-black bg-white block h-full w-full border-0 bg-transparent py-0 pl-8 pr-0 dark:text-white text-black focus:ring-0 sm:text-sm" | ||
placeholder="eg: Twitter accounts, Persona public keys, wallet addresses or ENS" | ||
type="search" | ||
name="search" | ||
onFocus={onFocus} | ||
onChange={handleKeywordChange} | ||
value={keyword} | ||
autoComplete="off" | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} |
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
Oops, something went wrong.