Skip to content

Commit

Permalink
fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymczakJ committed Sep 26, 2024
1 parent 38ba637 commit e9cba4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
39 changes: 22 additions & 17 deletions src/components/Search/SearchRouter/SearchRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,28 @@ function SearchRouter() {
setUserSearchQuery(undefined);
};

const onSearchChange = debounce((userQuery: string) => {
if (!userQuery) {
clearUserQuery();
return;
}
listRef.current?.updateAndScrollToFocusedIndex(0);
const queryJSON = SearchUtils.buildSearchQueryJSON(userQuery);

if (queryJSON) {
// eslint-disable-next-line
console.log('parsedQuery', queryJSON);

setUserSearchQuery(queryJSON);
} else {
// Handle query parsing error
}
}, SEARCH_DEBOUNCE_DELAY);
const onSearchChange = useMemo(
// eslint-disable-next-line react-compiler/react-compiler
() =>
debounce((userQuery: string) => {
if (!userQuery) {
clearUserQuery();
return;
}
listRef.current?.updateAndScrollToFocusedIndex(0);
const queryJSON = SearchUtils.buildSearchQueryJSON(userQuery);

if (queryJSON) {
// eslint-disable-next-line
console.log('parsedQuery', queryJSON);

setUserSearchQuery(queryJSON);
} else {
// Handle query parsing error
}
}, SEARCH_DEBOUNCE_DELAY),
[],
);

const updateUserSearchQuery = (newSearchQuery: string) => {
setTextInputValue(newSearchQuery);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/SearchRouter/SearchRouterList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function SearchRouterList(
sections={sections}
onSelectRow={onSelectRow}
ListItem={SearchRouterItem}
containerStyle={styles.mh100}
containerStyle={[styles.mh100, styles.mt2]}
ref={ref}
/>
);
Expand Down

0 comments on commit e9cba4e

Please sign in to comment.