From afacd93648b434a481eecc846f5dd905e333fa5f Mon Sep 17 00:00:00 2001 From: Heather Yu <35639529+hetd54@users.noreply.github.com> Date: Mon, 4 Dec 2023 09:29:45 -0500 Subject: [PATCH] refactor: conditionally render error p tag --- .../gatsby-theme-project-portal/src/components/SiteSearch.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/gatsby-theme-project-portal/src/components/SiteSearch.tsx b/packages/gatsby-theme-project-portal/src/components/SiteSearch.tsx index c63cfcc23..a596babb3 100644 --- a/packages/gatsby-theme-project-portal/src/components/SiteSearch.tsx +++ b/packages/gatsby-theme-project-portal/src/components/SiteSearch.tsx @@ -48,7 +48,9 @@ export const SiteSearch: FunctionComponent = ({ placeholder={"Type to search pages..."} onChange={(e) => setSearchQuery(e.target.value)} /> -

{errorMessage}

+ {errorMessage && ( +

{errorMessage}

+ )}
Number of found pages: {queryResults.length}