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

Signed-off-by: Andrew Thauer <athauer@wealthsimple.com>
This commit is contained in:
Andrew Thauer
2022-11-29 21:31:53 -05:00
parent 73810789c7
commit c8f49ed4d0
2 changed files with 18 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-explore': patch
---
Update search links to only have header as linkable text
@@ -69,7 +69,7 @@ export function ToolSearchResultListItem(props: ToolSearchResultListItemProps) {
};
return (
<Link noTrack to={result.location} onClick={handleClick}>
<>
<ListItem alignItems="flex-start">
{props.icon && <ListItemIcon>{props.icon}</ListItemIcon>}
<div className={classes.flexContainer}>
@@ -77,15 +77,17 @@ export function ToolSearchResultListItem(props: ToolSearchResultListItemProps) {
className={classes.itemText}
primaryTypographyProps={{ variant: 'h6' }}
primary={
props.highlight?.fields.title ? (
<HighlightedSearchResultText
text={props.highlight.fields.title}
preTag={props.highlight.preTag}
postTag={props.highlight.postTag}
/>
) : (
result.title
)
<Link noTrack to={result.location} onClick={handleClick}>
{props.highlight?.fields.title ? (
<HighlightedSearchResultText
text={props.highlight.fields.title}
preTag={props.highlight.preTag}
postTag={props.highlight.postTag}
/>
) : (
result.title
)}
</Link>
}
secondary={
props.highlight?.fields.text ? (
@@ -108,6 +110,6 @@ export function ToolSearchResultListItem(props: ToolSearchResultListItemProps) {
</div>
</ListItem>
<Divider component="li" />
</Link>
</>
);
}