From 3c57aa49f3ce451c44a171326628b0beed4016ea Mon Sep 17 00:00:00 2001 From: Ian Woodard Date: Wed, 20 Jul 2022 21:35:43 -0700 Subject: [PATCH] Moving account data to a context provider --- src/App.tsx | 89 ++++++++++--------- src/components/header/ConnectWalletButton.tsx | 8 +- src/components/header/Header.tsx | 12 ++- src/components/pool/ConnectWallet.tsx | 6 +- src/components/pool/WithdrawTab.tsx | 5 +- .../poolstats/PoolPositionWidget.tsx | 9 +- src/data/context/AccountContext.tsx | 46 ++++++++++ src/data/hooks/UseDeposit.ts | 7 +- src/pages/BlendPoolPage.tsx | 18 +--- src/pages/PortfolioPage.tsx | 6 +- 10 files changed, 117 insertions(+), 89 deletions(-) create mode 100644 src/data/context/AccountContext.tsx diff --git a/src/App.tsx b/src/App.tsx index eb4533b..cbc93cb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,6 +22,7 @@ import { HttpLink, gql, } from '@apollo/react-hooks'; +import { AccountProvider } from './data/context/AccountContext'; export const theGraphUniswapV2Client = new ApolloClient({ link: new HttpLink({ @@ -83,50 +84,52 @@ function App() { - - -
-
- - - } - > - } /> - } - /> - } - /> + + + +
+
+ } - /> - - } /> - { // Devmode-only example page routing - IS_DEV && ( - <> - } /> - } /> - } /> - } /> - - )} - } /> - } /> - -
-
- + path='/blend' + element={ + + } + > + } /> + } + /> + } + /> + } + /> + + } /> + { // Devmode-only example page routing + IS_DEV && ( + <> + } /> + } /> + } /> + } /> + + )} + } /> + } /> + +
+