From ee0ea1a2e3c603fa6026a0a48cda0c093e3b3565 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 19 Feb 2022 06:17:40 -0300 Subject: [PATCH] Extract common component --- src/address/AddressTransactionResults.tsx | 64 ++++++++++------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/src/address/AddressTransactionResults.tsx b/src/address/AddressTransactionResults.tsx index cc8665e..f19a43a 100644 --- a/src/address/AddressTransactionResults.tsx +++ b/src/address/AddressTransactionResults.tsx @@ -11,7 +11,7 @@ import { SelectionContext, useSelection } from "../useSelection"; import { useMultipleETHUSDOracle } from "../usePriceOracle"; import { RuntimeContext } from "../useRuntime"; import { useParams, useSearchParams } from "react-router-dom"; -import { ChecksummedAddress } from "../types"; +import { ChecksummedAddress, ProcessedTransaction } from "../types"; import { useContractsMetadata } from "../hooks"; type AddressTransactionResultsProps = { @@ -120,23 +120,7 @@ const AddressTransactionResults: React.FC = ({ return ( -
-
- {page === undefined ? ( - <>Waiting for search results... - ) : ( - <>{page.length} transactions on this page - )} -
- -
+ = ({ metadatas={metadatas} /> ))} -
-
- {page === undefined ? ( - <>Waiting for search results... - ) : ( - <>{page.length} transactions on this page - )} -
- -
+ ) : ( @@ -178,4 +146,30 @@ const AddressTransactionResults: React.FC = ({ ); }; +type NavBarProps = { + address: ChecksummedAddress; + page: ProcessedTransaction[] | undefined; + controller: SearchController | undefined; +}; + +const NavBar: React.FC = ({ address, page, controller }) => ( +
+
+ {page === undefined ? ( + <>Waiting for search results... + ) : ( + <>{page.length} transactions on this page + )} +
+ +
+); + export default AddressTransactionResults;