fix(search): update to only link title in search results
Signed-off-by: Jonathan Sundquist <jonathan.sundquist@factset.com>
This commit is contained in:
@@ -81,6 +81,15 @@ export const TechDocsSearchResultListItem = (
|
||||
});
|
||||
};
|
||||
|
||||
const LinkWrapper = ({ children }: PropsWithChildren<{}>) =>
|
||||
asLink ? (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{children}
|
||||
</Link>
|
||||
) : (
|
||||
<>{children}</>
|
||||
);
|
||||
|
||||
const TextItem = () => {
|
||||
const resultTitle = highlight?.fields.title ? (
|
||||
<HighlightedSearchResultText
|
||||
@@ -118,11 +127,11 @@ export const TechDocsSearchResultListItem = (
|
||||
primaryTypographyProps={{ variant: 'h6' }}
|
||||
primary={
|
||||
title ? (
|
||||
title
|
||||
<LinkWrapper>{title}</LinkWrapper>
|
||||
) : (
|
||||
<>
|
||||
<LinkWrapper>
|
||||
{resultTitle} | {entityTitle ?? resultName} docs
|
||||
</>
|
||||
</LinkWrapper>
|
||||
)
|
||||
}
|
||||
secondary={
|
||||
@@ -149,15 +158,6 @@ export const TechDocsSearchResultListItem = (
|
||||
);
|
||||
};
|
||||
|
||||
const LinkWrapper = ({ children }: PropsWithChildren<{}>) =>
|
||||
asLink ? (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{children}
|
||||
</Link>
|
||||
) : (
|
||||
<>{children}</>
|
||||
);
|
||||
|
||||
const ListItemWrapper = ({ children }: PropsWithChildren<{}>) =>
|
||||
asListItem ? (
|
||||
<>
|
||||
@@ -172,10 +172,8 @@ export const TechDocsSearchResultListItem = (
|
||||
);
|
||||
|
||||
return (
|
||||
<LinkWrapper>
|
||||
<ListItemWrapper>
|
||||
<TextItem />
|
||||
</ListItemWrapper>
|
||||
</LinkWrapper>
|
||||
<ListItemWrapper>
|
||||
<TextItem />
|
||||
</ListItemWrapper>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user