This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fast scroll button, search function on logs box
- Loading branch information
1 parent
defc1c4
commit db21f8d
Showing
5 changed files
with
113 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { useState } from 'react'; | ||
import { Box, IconButton, TextField } from '@material-ui/core'; | ||
import SearchIcon from '@material-ui/icons/Search'; | ||
import CloseIcon from '@material-ui/icons/Close'; | ||
|
||
export function ExpandableSearchBox({ | ||
query, | ||
setQuery, | ||
}: { | ||
query: string; | ||
setQuery: (query: string) => void; | ||
}) { | ||
const [expanded, setExpanded] = useState(false); | ||
|
||
return ( | ||
<Box display="flex" justifyContent="center"> | ||
<Box display="flex" alignItems="center" gap="0.5rem"> | ||
{expanded ? ( | ||
<> | ||
<TextField | ||
value={query} | ||
onChange={(e) => setQuery(e.target.value)} | ||
autoFocus | ||
size="small" | ||
/> | ||
<IconButton | ||
onClick={() => { | ||
setExpanded(false); | ||
setQuery(''); | ||
}} | ||
size="small" | ||
> | ||
<CloseIcon /> | ||
</IconButton> | ||
</> | ||
) : ( | ||
<IconButton onClick={() => setExpanded(true)} size="small"> | ||
<SearchIcon /> | ||
</IconButton> | ||
)} | ||
</Box> | ||
</Box> | ||
); | ||
} |
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