Skip to content

Commit

Permalink
Merge pull request #1072 from newrelic/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
sunnyzanchi authored Jul 1, 2024
2 parents 348670d + 104ad9b commit 207bc88
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
14 changes: 7 additions & 7 deletions packages/gatsby-theme-newrelic/src/components/SearchInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ const HORIZONTAL_SPACING = {
const SearchInput = forwardRef(
(
{
focusWithHotKey,
onClear,
onSubmit,
value,
width,
size = 'medium',
alignIcon = 'left',
className,
focusWithHotKey,
iconName = 'fe-search',
alignIcon = 'left',
isIconClickable = false,
onBlur,
onClear,
onFocus,
onSubmit,
size = 'medium',
value,
width,
...props
},
ref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import Tag from '../Tag';
import useLocale from '../../hooks/useLocale';

const Result = memo(
forwardRef(({ result, selected, onSelect }, ref) => {
forwardRef(({ position, result, selected, onSelect }, ref) => {
const locale = useLocale();

return (
<Link
instrumentation={{ searchResult: true, position }}
to={result.url}
ref={ref}
role="option"
Expand Down Expand Up @@ -92,6 +93,11 @@ const Result = memo(
);

Result.propTypes = {
/**
* The result's index in the list of results.
* Used for instrumentation, starts at 0.
*/
position: PropTypes.number.isRequired,
result: PropTypes.object.isRequired,
selected: PropTypes.bool,
onSelect: PropTypes.func,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const ResultList = ({ results, selectedIndex, onSelectIndex }) => {

return (
<Result
position={idx}
key={result.id}
ref={isSelected ? selectedRef : null}
selected={isSelected}
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby-theme-newrelic/src/pages/404.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ const NotFoundPage = ({
text-decoration: none;
`}
instrumentation={{
position: index,
component: '404SuggestedLink',
href: result.url,
searchTerm,
searchResult: true,
}}
displayExternalIcon
>
Expand Down

0 comments on commit 207bc88

Please sign in to comment.