Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Yen Truong committed Dec 8, 2021
1 parent d7aa859 commit 41d8fbb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sample-app/src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default function SearchBar({
return {
value: result.value,
render: (onClick: () => void, isOptionFocus: boolean) =>
renderAutocompleteResult(result, onClick, cssClasses as AutocompleteResultCssClasses, isOptionFocus)
renderAutocompleteResult(result, onClick, cssClasses, isOptionFocus)
}
}) ?? [];

Expand Down
10 changes: 7 additions & 3 deletions sample-app/src/components/VisualAutocomplete/VisualSearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import useSearchWithNearMeHandling from '../../hooks/useSearchWithNearMeHandling
import { builtInCssClasses as builtInSearchBarCssClasses, SearchBarCssClasses } from '../SearchBar';
import { CompositionMethod, useComposedCssClasses } from '../../hooks/useComposedCssClasses';
import { ReactComponent as YextLogoIcon } from '../../icons/yext_logo.svg';
import renderAutocompleteResult, { AutocompleteResultCssClasses } from '../utils/renderAutocompleteResult';
import renderAutocompleteResult from '../utils/renderAutocompleteResult';
import { ReactComponent as RecentSearchIcon } from '../../icons/history.svg';
import useRecentSearches from '../../hooks/useRecentSearches';
import classNames from 'classnames';
Expand Down Expand Up @@ -116,7 +116,11 @@ export default function VisualSearchBar({
return null;
}
const options = autocompleteResults.map(result => {
const verticalKeys = hideVerticalLinks ? undefined : ['people', 'events'];//result.verticalKeys;
/**
* TODO (yen-tt): mocked data is used for testing purposes.
* Should be replace with result.verticalKeys when backend work is done.
*/
const verticalKeys = hideVerticalLinks ? undefined : ['people', 'financial_professionals'];
const verticalLinks = verticalKeyToNameMapping && verticalKeys?.map(verticalKey => {
return {
label: verticalKeyToNameMapping[verticalKey],
Expand All @@ -130,7 +134,7 @@ export default function VisualSearchBar({
renderAutocompleteResult(
result,
onClick,
cssClasses as AutocompleteResultCssClasses,
cssClasses,
isOptionFocus,
verticalLinks,
focusLinkIndex
Expand Down

0 comments on commit 41d8fbb

Please sign in to comment.