move link outside of ternary
Signed-off-by: Jonathan Sundquist <jonathan.sundquist@factset.com>
This commit is contained in:
@@ -70,19 +70,17 @@ export function AdrSearchResultListItem(props: {
|
||||
className={classes.itemText}
|
||||
primaryTypographyProps={{ variant: 'h6' }}
|
||||
primary={
|
||||
highlight?.fields.title ? (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{highlight?.fields.title ? (
|
||||
<HighlightedSearchResultText
|
||||
text={highlight.fields.title}
|
||||
preTag={highlight.preTag}
|
||||
postTag={highlight.postTag}
|
||||
text={highlight?.fields.title || ''}
|
||||
preTag={highlight?.preTag || ''}
|
||||
postTag={highlight?.postTag || ''}
|
||||
/>
|
||||
</Link>
|
||||
) : (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{result.title}
|
||||
</Link>
|
||||
)
|
||||
) : (
|
||||
result.title
|
||||
)}
|
||||
</Link>
|
||||
}
|
||||
secondary={
|
||||
<span
|
||||
|
||||
+14
-15
@@ -60,6 +60,7 @@ export function CatalogSearchResultListItem(
|
||||
props: CatalogSearchResultListItemProps,
|
||||
) {
|
||||
const result = props.result as any;
|
||||
const highlight = props.highlight as ResultHighlight;
|
||||
|
||||
const classes = useStyles();
|
||||
const analytics = useAnalytics();
|
||||
@@ -79,26 +80,24 @@ export function CatalogSearchResultListItem(
|
||||
className={classes.itemText}
|
||||
primaryTypographyProps={{ variant: 'h6' }}
|
||||
primary={
|
||||
props.highlight?.fields.title ? (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{highlight?.fields.title ? (
|
||||
<HighlightedSearchResultText
|
||||
text={props.highlight.fields.title}
|
||||
preTag={props.highlight.preTag}
|
||||
postTag={props.highlight.postTag}
|
||||
text={highlight.fields.title}
|
||||
preTag={highlight.preTag}
|
||||
postTag={highlight.postTag}
|
||||
/>
|
||||
</Link>
|
||||
) : (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{result.title}
|
||||
</Link>
|
||||
)
|
||||
) : (
|
||||
result.title
|
||||
)}
|
||||
</Link>
|
||||
}
|
||||
secondary={
|
||||
props.highlight?.fields.text ? (
|
||||
highlight?.fields.text ? (
|
||||
<HighlightedSearchResultText
|
||||
text={props.highlight.fields.text}
|
||||
preTag={props.highlight.preTag}
|
||||
postTag={props.highlight.postTag}
|
||||
text={highlight.fields.text}
|
||||
preTag={highlight.preTag}
|
||||
postTag={highlight.postTag}
|
||||
/>
|
||||
) : (
|
||||
result.text
|
||||
|
||||
+9
-11
@@ -72,19 +72,17 @@ export const DefaultResultListItemComponent = ({
|
||||
<ListItemText
|
||||
primaryTypographyProps={{ variant: 'h6' }}
|
||||
primary={
|
||||
highlight?.fields.title ? (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{highlight?.fields.title ? (
|
||||
<HighlightedSearchResultText
|
||||
text={highlight.fields.title}
|
||||
preTag={highlight.preTag}
|
||||
postTag={highlight.postTag}
|
||||
text={highlight?.fields.title || ''}
|
||||
preTag={highlight?.preTag || ''}
|
||||
postTag={highlight?.postTag || ''}
|
||||
/>
|
||||
</Link>
|
||||
) : (
|
||||
<Link noTrack to={result.location} onClick={handleClick}>
|
||||
{result.title}
|
||||
</Link>
|
||||
)
|
||||
) : (
|
||||
result.title
|
||||
)}
|
||||
</Link>
|
||||
}
|
||||
secondary={
|
||||
<span
|
||||
|
||||
@@ -126,13 +126,15 @@ export const TechDocsSearchResultListItem = (
|
||||
className={classes.itemText}
|
||||
primaryTypographyProps={{ variant: 'h6' }}
|
||||
primary={
|
||||
title ? (
|
||||
<LinkWrapper>{title}</LinkWrapper>
|
||||
) : (
|
||||
<LinkWrapper>
|
||||
{resultTitle} | {entityTitle ?? resultName} docs
|
||||
</LinkWrapper>
|
||||
)
|
||||
<LinkWrapper>
|
||||
{title ? (
|
||||
title
|
||||
) : (
|
||||
<>
|
||||
{resultTitle} | {entityTitle ?? resultName} docs
|
||||
</>
|
||||
)}
|
||||
</LinkWrapper>
|
||||
}
|
||||
secondary={
|
||||
<span
|
||||
|
||||
Reference in New Issue
Block a user