-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add search to cmd bar #667
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for abstracting useFilteredSearchEntityQuery
front/src/AppNavbar.tsx
Outdated
@@ -20,6 +22,8 @@ export function AppNavbar() { | |||
const theme = useTheme(); | |||
const currentPath = useLocation().pathname; | |||
|
|||
const setCommandBarOpen = useSetRecoilState(isCommandMenuOpenedState); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const setCommandBarOpen = useSetRecoilState(isCommandMenuOpenedState); | |
const setIsCommandMenuOpened = useSetRecoilState(isCommandMenuOpenedState); |
front/src/AppNavbar.tsx
Outdated
icon={<IconSearch size={theme.icon.size.md} />} | ||
soon={true} | ||
onClick={() => setCommandBarOpen(true)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClick={() => setCommandBarOpen(true)} | |
onClick={() => setIsCommandMenuOpened(true)} |
front/src/AppNavbar.tsx
Outdated
|
||
import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpened'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpened'; | |
import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpenedState'; |
@@ -43,6 +47,28 @@ export function usePeopleQuery( | |||
}); | |||
} | |||
|
|||
export function useFilteredSearchPeopleQuery( | |||
searchFilter: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you move these 3 parameters to an object: it improves the dev experience while using the function:
{ searchFilter: string, selectedPeopleIds: Array, limit?: number }
…redSearchEntityQuery
5ea4922
to
f1d88fc
Compare
Basic implementation of search in commandBar