refactor(dev-only): add animation to file view search box and fix search bar on mobile

This commit is contained in:
Aman Harwara
2022-12-25 00:02:36 +05:30
parent 40194d010f
commit 52d0fed437
4 changed files with 39 additions and 27 deletions

View File

@@ -12,9 +12,10 @@ import { ElementIds } from '@/Constants/ElementIDs'
type Props = {
itemListController: ItemListController
searchOptionsController: SearchOptionsController
hideOptions?: boolean
}
const SearchBar = ({ itemListController, searchOptionsController }: Props) => {
const SearchBar = ({ itemListController, searchOptionsController, hideOptions = false }: Props) => {
const searchInputRef = useRef<HTMLInputElement>(null)
const { noteFilterText, setNoteFilterText, clearFilterText, onFilterEnter } = itemListController
@@ -66,7 +67,7 @@ const SearchBar = ({ itemListController, searchOptionsController }: Props) => {
roundedFull
/>
{(focusedSearch || noteFilterText) && (
{(focusedSearch || noteFilterText) && !hideOptions && (
<div className="animate-fade-from-top">
<SearchOptions searchOptions={searchOptionsController} />
</div>