From 81e945d052ad3083cbdd4fbc112a9283bf2ffef5 Mon Sep 17 00:00:00 2001 From: Jonathan Sundquist Date: Tue, 15 Nov 2022 09:24:28 -0600 Subject: [PATCH] move link outside of ternary Signed-off-by: Jonathan Sundquist --- .../src/search/AdrSearchResultListItem.tsx | 20 ++++++------- .../CatalogSearchResultListItem.tsx | 29 +++++++++---------- .../DefaultResultListItem.tsx | 20 ++++++------- .../TechDocsSearchResultListItem.tsx | 16 +++++----- 4 files changed, 41 insertions(+), 44 deletions(-) diff --git a/plugins/adr/src/search/AdrSearchResultListItem.tsx b/plugins/adr/src/search/AdrSearchResultListItem.tsx index f7d9bcbe57..97847ba67b 100644 --- a/plugins/adr/src/search/AdrSearchResultListItem.tsx +++ b/plugins/adr/src/search/AdrSearchResultListItem.tsx @@ -70,19 +70,17 @@ export function AdrSearchResultListItem(props: { className={classes.itemText} primaryTypographyProps={{ variant: 'h6' }} primary={ - highlight?.fields.title ? ( - + + {highlight?.fields.title ? ( - - ) : ( - - {result.title} - - ) + ) : ( + result.title + )} + } secondary={ + + {highlight?.fields.title ? ( - - ) : ( - - {result.title} - - ) + ) : ( + result.title + )} + } secondary={ - props.highlight?.fields.text ? ( + highlight?.fields.text ? ( ) : ( result.text diff --git a/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx b/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx index 44c83fe5d5..830cb61780 100644 --- a/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx +++ b/plugins/search-react/src/components/DefaultResultListItem/DefaultResultListItem.tsx @@ -72,19 +72,17 @@ export const DefaultResultListItemComponent = ({ + + {highlight?.fields.title ? ( - - ) : ( - - {result.title} - - ) + ) : ( + result.title + )} + } secondary={ {title} - ) : ( - - {resultTitle} | {entityTitle ?? resultName} docs - - ) + + {title ? ( + title + ) : ( + <> + {resultTitle} | {entityTitle ?? resultName} docs + + )} + } secondary={