Skip to content
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

Merged
merged 9 commits into from
Jul 15, 2023
Merged

Add search to cmd bar #667

merged 9 commits into from
Jul 15, 2023

Conversation

FelixMalfait
Copy link
Member

Basic implementation of search in commandBar

Screenshot 2023-07-15 at 16 39 10

Copy link
Contributor

@lucasbordeau lucasbordeau left a 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

@@ -20,6 +22,8 @@ export function AppNavbar() {
const theme = useTheme();
const currentPath = useLocation().pathname;

const setCommandBarOpen = useSetRecoilState(isCommandMenuOpenedState);
Copy link
Contributor

@lucasbordeau lucasbordeau Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const setCommandBarOpen = useSetRecoilState(isCommandMenuOpenedState);
const setIsCommandMenuOpened = useSetRecoilState(isCommandMenuOpenedState);

icon={<IconSearch size={theme.icon.size.md} />}
soon={true}
onClick={() => setCommandBarOpen(true)}
Copy link
Contributor

@lucasbordeau lucasbordeau Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onClick={() => setCommandBarOpen(true)}
onClick={() => setIsCommandMenuOpened(true)}


import { isCommandMenuOpenedState } from '@/command-menu/states/isCommandMenuOpened';
Copy link
Contributor

@lucasbordeau lucasbordeau Jul 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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,
Copy link
Member

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 }

@charlesBochet charlesBochet force-pushed the add-search-to-cmd-bar branch from 5ea4922 to f1d88fc Compare July 15, 2023 21:59
@charlesBochet charlesBochet merged commit 7959308 into main Jul 15, 2023
@charlesBochet charlesBochet deleted the add-search-to-cmd-bar branch July 15, 2023 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants