Merge pull request #14615 from jsundquist/master

fix(search): update to only link title in search results
This commit is contained in:
Patrik Oldsberg
2022-11-28 15:10:38 +01:00
committed by GitHub
6 changed files with 81 additions and 61 deletions
@@ -66,21 +66,23 @@ export const DefaultResultListItemComponent = ({
};
return (
<Link noTrack to={result.location} onClick={handleClick}>
<>
<ListItem alignItems="center">
{icon && <ListItemIcon>{icon}</ListItemIcon>}
<ListItemText
primaryTypographyProps={{ variant: 'h6' }}
primary={
highlight?.fields.title ? (
<HighlightedSearchResultText
text={highlight.fields.title}
preTag={highlight.preTag}
postTag={highlight.postTag}
/>
) : (
result.title
)
<Link noTrack to={result.location} onClick={handleClick}>
{highlight?.fields.title ? (
<HighlightedSearchResultText
text={highlight?.fields.title || ''}
preTag={highlight?.preTag || ''}
postTag={highlight?.postTag || ''}
/>
) : (
result.title
)}
</Link>
}
secondary={
<span
@@ -106,7 +108,7 @@ export const DefaultResultListItemComponent = ({
{secondaryAction && <Box alignItems="flex-end">{secondaryAction}</Box>}
</ListItem>
<Divider />
</Link>
</>
);
};