fix(search): update to only link title in search results

Signed-off-by: Jonathan Sundquist <jonathan.sundquist@factset.com>
This commit is contained in:
Jonathan Sundquist
2022-11-14 08:51:14 -06:00
parent 50b941cf6b
commit a19cffbeed
6 changed files with 67 additions and 44 deletions
@@ -66,20 +66,24 @@ 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}
/>
<Link noTrack to={result.location} onClick={handleClick}>
<HighlightedSearchResultText
text={highlight.fields.title}
preTag={highlight.preTag}
postTag={highlight.postTag}
/>
</Link>
) : (
result.title
<Link noTrack to={result.location} onClick={handleClick}>
{result.title}
</Link>
)
}
secondary={
@@ -106,7 +110,7 @@ export const DefaultResultListItemComponent = ({
{secondaryAction && <Box alignItems="flex-end">{secondaryAction}</Box>}
</ListItem>
<Divider />
</Link>
</>
);
};