@@ -40,7 +36,7 @@ export default function ConnectWallet() {
By investing with Aloe, you will be able to earn trading fees on Uniswap, collect interest from other protocols, and autonomously manage your portfolio.
-
+
);
}
diff --git a/src/components/pool/WithdrawTab.tsx b/src/components/pool/WithdrawTab.tsx
index 0cb5ae3..085dfec 100644
--- a/src/components/pool/WithdrawTab.tsx
+++ b/src/components/pool/WithdrawTab.tsx
@@ -1,7 +1,7 @@
import Big from 'big.js';
import React, { useContext, useEffect, useMemo, useState } from 'react';
import styled from 'styled-components';
-import { useAccount, useBalance, useSigner } from 'wagmi';
+import { useBalance, useSigner } from 'wagmi';
import { withdraw } from '../../connector/BlendWithdrawActions';
import {
BlendPoolDrawData,
@@ -26,6 +26,7 @@ import TransactionFailedModal from './modal/TransactionFailedModal';
import TokenBreakdown from '../common/TokenBreakdown';
import { Text } from '../common/Typography';
import { OffChainPoolStats } from '../../data/PoolStats';
+import { AccountContext } from '../../data/context/AccountContext';
const LABEL_TEXT_COLOR = 'rgba(130, 160, 182, 1)';
@@ -89,7 +90,7 @@ export default function WithdrawTab(props: WithdrawTabProps) {
const [usdEstimate, setUsdEstimate] = useState('-')
const { poolStats } = useContext(BlendPoolContext);
- const [{ data: accountData }] = useAccount();
+ const { accountData } = useContext(AccountContext);
const [{ data: shareBalanceData }] = useBalance({
addressOrName: accountData?.address,
token: props.poolData.poolAddress,
diff --git a/src/components/poolstats/PoolPositionWidget.tsx b/src/components/poolstats/PoolPositionWidget.tsx
index 5a1a74b..421bb26 100644
--- a/src/components/poolstats/PoolPositionWidget.tsx
+++ b/src/components/poolstats/PoolPositionWidget.tsx
@@ -12,12 +12,12 @@ import { RESPONSIVE_BREAKPOINT_MD, RESPONSIVE_BREAKPOINT_XS } from '../../data/c
import { API_URL } from '../../data/constants/Values';
import { BlendPoolContext } from '../../data/context/BlendPoolContext';
import { OffChainPoolStats } from '../../data/PoolStats';
-import { AccountData } from '../../pages/BlendPoolPage';
import { formatUSDAuto, toBig } from '../../util/Numbers';
import { PoolReturns, TokenReturns } from '../../util/ReturnsCalculations';
import { PercentChange } from '../common/PercentChange';
import { Display, Text } from '../common/Typography';
import WidgetHeading from '../common/WidgetHeading';
+import { AccountContext } from '../../data/context/AccountContext';
const PERFORMANCE_LABEL_TEXT_COLOR = 'rgba(130, 160, 182, 1)';
const PERFORMANCE_VALUE_TEXT_COLOR = 'rgba(255, 255, 255, 1)';
@@ -103,15 +103,12 @@ export type PoolPositionWidgetProps = {
walletIsConnected: boolean;
poolData: BlendPoolMarkers;
offChainPoolStats: OffChainPoolStats | undefined;
- accountData: AccountData | undefined;
};
export default function PoolPositionWidget(props: PoolPositionWidgetProps) {
-
- const { walletIsConnected, poolData, offChainPoolStats, accountData } = props;
+ const { walletIsConnected, poolData, offChainPoolStats } = props;
const { poolStats } = useContext(BlendPoolContext);
-
- // const [{ data: accountData }] = useAccount();
+ const { accountData } = useContext(AccountContext);
const [{ data: accountShareBalance }] = useBalance({
addressOrName: accountData?.address,
token: poolData.poolAddress,
diff --git a/src/data/context/AccountContext.tsx b/src/data/context/AccountContext.tsx
new file mode 100644
index 0000000..ed54a6c
--- /dev/null
+++ b/src/data/context/AccountContext.tsx
@@ -0,0 +1,46 @@
+import React from 'react';
+import { Connector, useAccount } from 'wagmi';
+
+export type AccountData = {
+ address: string;
+ connector: Connector