From 30343f562668d5719fd202c0019df21e0ceddb2d Mon Sep 17 00:00:00 2001 From: Matt Upham <30577966+mattupham@users.noreply.github.com> Date: Fri, 9 Aug 2024 08:45:02 -0700 Subject: [PATCH] Clean up --- .../recent-activity/recent-activity.tsx | 40 +++++-------------- packages/web/pages/transactions.tsx | 1 - 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/packages/web/components/transactions/recent-activity/recent-activity.tsx b/packages/web/components/transactions/recent-activity/recent-activity.tsx index 4572fd639c..67bc1b80ff 100644 --- a/packages/web/components/transactions/recent-activity/recent-activity.tsx +++ b/packages/web/components/transactions/recent-activity/recent-activity.tsx @@ -1,4 +1,3 @@ -import { FormattedTransaction } from "@osmosis-labs/server"; import { observer } from "mobx-react-lite"; import { FunctionComponent } from "react"; @@ -11,14 +10,6 @@ import { api } from "~/utils/trpc"; import { SwapRow } from "./recent-activity-transaction-row"; -type ActivityType = "transaction" | "recentTransfer"; - -interface MergedActivityMetadata { - type: ActivityType; - compareDate: Date; - compareTxHash: string; -} - const ACTIVITY_LIMIT = 5; const RecentActivitySkeleton = () => { @@ -43,7 +34,7 @@ export const RecentActivity: FunctionComponent = observer(() => { const { t } = useTranslation(); - const { data: transactionsData, isFetching: isGetTransactionsFetching } = + const { data: transactionsData, isLoading: isGetTransactionsLoading } = api.edge.transactions.getTransactions.useQuery( { address: wallet?.address || "", @@ -55,11 +46,8 @@ export const RecentActivity: FunctionComponent = observer(() => { } ); - const isLoading = isWalletLoading || isGetTransactionsFetching; - const { transactions } = transactionsData ?? { transactions: [], - hasNextPage: false, }; const topActivity = transactions.slice(0, ACTIVITY_LIMIT); @@ -77,44 +65,36 @@ export const RecentActivity: FunctionComponent = observer(() => { />
- {isLoading ? ( + {isGetTransactionsLoading ? ( ) : topActivity?.length === 0 ? ( ) : ( topActivity.map((activity) => { - const recentTransactionActivity = activity as FormattedTransaction & - MergedActivityMetadata; - return ( diff --git a/packages/web/pages/transactions.tsx b/packages/web/pages/transactions.tsx index f96b9fcc1e..99410f1913 100644 --- a/packages/web/pages/transactions.tsx +++ b/packages/web/pages/transactions.tsx @@ -56,7 +56,6 @@ const Transactions: React.FC = observer(() => { const { data, isFetching: isGetTransactionsFetching } = api.edge.transactions.getTransactions.useQuery( { - // address: EXAMPLE.ADDRESS, address, page: pageString, pageSize: pageSizeString,