From 3d1dc8f38a883685b6c107bece2e75afe8119bf5 Mon Sep 17 00:00:00 2001 From: Aman Harwara Date: Wed, 17 Aug 2022 19:12:40 +0530 Subject: [PATCH] feat: move search bar back to notes column (#1408) --- .../Components/ApplicationView/ApplicationView.tsx | 1 + .../Components/ContentListView/ContentListView.tsx | 5 +++++ .../src/javascripts/Components/Navigation/Navigation.tsx | 6 ------ .../src/javascripts/Components/SearchBar/SearchBar.tsx | 8 +++----- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx b/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx index 43f1e2fb5..2b00fd37d 100644 --- a/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx +++ b/packages/web/src/javascripts/Components/ApplicationView/ApplicationView.tsx @@ -194,6 +194,7 @@ const ApplicationView: FunctionComponent = ({ application, mainApplicatio noteTagsController={viewControllerManager.noteTagsController} notesController={viewControllerManager.notesController} selectionController={viewControllerManager.selectionController} + searchOptionsController={viewControllerManager.searchOptionsController} /> diff --git a/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx b/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx index 0c0c965a1..c1677d755 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx @@ -21,6 +21,8 @@ import ResponsivePaneContent from '../ResponsivePane/ResponsivePaneContent' import { AppPaneId } from '../ResponsivePane/AppPaneMetadata' import { useResponsiveAppPane } from '../ResponsivePane/ResponsivePaneProvider' import { StreamingFileReader } from '@standardnotes/filepicker' +import SearchBar from '../SearchBar/SearchBar' +import { SearchOptionsController } from '@/Controllers/SearchOptionsController' import { classNames } from '@/Utils/ConcatenateClassNames' type Props = { @@ -33,6 +35,7 @@ type Props = { noteTagsController: NoteTagsController notesController: NotesController selectionController: SelectedItemsController + searchOptionsController: SearchOptionsController } const ContentListView: FunctionComponent = ({ @@ -45,6 +48,7 @@ const ContentListView: FunctionComponent = ({ noteTagsController, notesController, selectionController, + searchOptionsController, }) => { const { toggleAppPane } = useResponsiveAppPane() @@ -215,6 +219,7 @@ const ContentListView: FunctionComponent = ({ isFilesSmartView={isFilesSmartView} optionsSubtitle={optionsSubtitle} /> + = ({ application }) => { ref={ref} > -
diff --git a/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx b/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx index 04a9ee035..fec855215 100644 --- a/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx +++ b/packages/web/src/javascripts/Components/SearchBar/SearchBar.tsx @@ -8,12 +8,11 @@ import DecoratedInput from '../Input/DecoratedInput' import { observer } from 'mobx-react-lite' type Props = { - selectedViewTitle?: string itemListController: ItemListController searchOptionsController: SearchOptionsController } -const SearchBar = ({ itemListController, searchOptionsController, selectedViewTitle = 'Notes' }: Props) => { +const SearchBar = ({ itemListController, searchOptionsController }: Props) => { const searchInputRef = useRef(null) const { noteFilterText, setNoteFilterText, clearFilterText, onFilterEnter } = itemListController @@ -45,15 +44,14 @@ const SearchBar = ({ itemListController, searchOptionsController, selectedViewTi }, [clearFilterText]) return ( -
+