From 7e0e619b8c69e8c66072d3ea3260b0b808f66444 Mon Sep 17 00:00:00 2001 From: Callum McIntyre Date: Tue, 18 Jul 2023 17:00:25 +0100 Subject: [PATCH] Add missing TransactionsProvider to address/tokens page (#276) This is required for the TokenHistoryCard Fixes #274 --- app/address/[address]/tokens/page.tsx | 6 ++++-- app/providers/transactions/index.tsx | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/address/[address]/tokens/page.tsx b/app/address/[address]/tokens/page.tsx index b63f920f..7a43d450 100644 --- a/app/address/[address]/tokens/page.tsx +++ b/app/address/[address]/tokens/page.tsx @@ -3,6 +3,8 @@ import { TokenHistoryCard } from '@components/account/TokenHistoryCard'; import getReadableTitleFromAddress, { AddressPageMetadataProps } from '@utils/get-readable-title-from-address'; import { Metadata } from 'next/types'; +import { TransactionsProvider } from '@/app/providers/transactions'; + type Props = Readonly<{ params: { address: string; @@ -18,9 +20,9 @@ export async function generateMetadata(props: AddressPageMetadataProps): Promise export default function OwnedTokensPage({ params: { address } }: Props) { return ( - <> + - + ); } diff --git a/app/providers/transactions/index.tsx b/app/providers/transactions/index.tsx index 15cad5ec..532e73d7 100644 --- a/app/providers/transactions/index.tsx +++ b/app/providers/transactions/index.tsx @@ -123,14 +123,6 @@ export async function fetchTransactionStatus( }); } -export function useTransactions() { - const context = React.useContext(StateContext); - if (!context) { - throw new Error(`useTransactions must be used within a TransactionsProvider`); - } - return context; -} - export function useTransactionStatus( signature: TransactionSignature | undefined ): Cache.CacheEntry | undefined {