From b349d8953475efd106cee83eae8da7e9d74a0c8a Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Tue, 14 Jun 2022 12:48:49 -0400 Subject: [PATCH] Add options to Page props --- src/components/Page.tsx | 16 +++++++++++----- src/routes/search.tsx | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/Page.tsx b/src/components/Page.tsx index 7772e495c..399c1a55c 100644 --- a/src/components/Page.tsx +++ b/src/components/Page.tsx @@ -1,16 +1,22 @@ -import React, { FunctionComponent, useEffect, useRef } from 'react'; +import React, { FunctionComponent, HTMLAttributes, useEffect, useRef } from 'react'; import viewManager from './viewManager/viewManager'; type PageProps = { - title?: string + title?: string, + isBackButtonEnabled?: boolean }; /** * Page component that handles hiding active non-react views, triggering the required events for * navigation and appRouter state updates, and setting the correct classes and data attributes. */ -const Page: FunctionComponent = ({ children, title }) => { +const Page: FunctionComponent> = ({ + children, + className = '', + title, + isBackButtonEnabled = true +}) => { const element = useRef(null); useEffect(() => { @@ -38,9 +44,9 @@ const Page: FunctionComponent = ({ children, title }) => {
{children}
diff --git a/src/routes/search.tsx b/src/routes/search.tsx index 864af6141..cd50e9e0b 100644 --- a/src/routes/search.tsx +++ b/src/routes/search.tsx @@ -13,7 +13,7 @@ const SearchPage: FunctionComponent = () => { const [ searchParams ] = useSearchParams(); return ( - + {!query &&