From 4b26ce040ea9b86bf059d7e4ab7862e8fa267958 Mon Sep 17 00:00:00 2001 From: Stuart Kuentzel Date: Thu, 13 Apr 2023 15:59:47 +0900 Subject: [PATCH] errors with useContext --- craco.config.js | 14 + package.json | 2 + src/App.tsx | 2 +- src/components/SwitchNetworks.tsx | 9 +- .../MainnetContainer.tsx | 22 + .../network-container/NetworkContainer.tsx | 14 + src/components/swap/Swap.tsx | 18 + yarn.lock | 2264 ++++++++++++++++- 8 files changed, 2322 insertions(+), 23 deletions(-) create mode 100644 src/components/main-content-container/MainnetContainer.tsx create mode 100644 src/components/swap/Swap.tsx diff --git a/craco.config.js b/craco.config.js index 6cb72aa..7265787 100644 --- a/craco.config.js +++ b/craco.config.js @@ -4,5 +4,19 @@ module.exports = { postcss: { plugins: [require('tailwindcss'), require('autoprefixer')] } + }, + webpack: { + configure: webpackConfig => { + // We're currently on Webpack 4.x that doesn't support the `exports` field in package.json. + // See https://github.com/webpack/webpack/issues/9509. + // + // In case you need to add more modules, make sure to remap them to the correct path. + // + // Map @uniswap/conedison to its dist folder. + // This is required because conedison uses * to redirect all imports to its dist. + webpackConfig.resolve.alias['@uniswap/conedison'] = '@uniswap/conedison/dist'; + + return webpackConfig; + } } }; diff --git a/package.json b/package.json index 1577cc3..8604d19 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,14 @@ "@types/node": "^12.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", + "@uniswap/widgets": "^2.51.1", "@walletconnect/web3-provider": "^1.6.5", "@web3-react/core": "^6.1.9", "arb-ts": "^0.0.42", "ethers": "^5.4.6", "react": "^17.0.2", "react-dom": "^17.0.2", + "react-redux": "^8.0.5", "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "typescript": "^4.1.2", diff --git a/src/App.tsx b/src/App.tsx index 83cccd5..08cc18e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -59,7 +59,7 @@ const App: React.FC = () => {
- + diff --git a/src/components/SwitchNetworks.tsx b/src/components/SwitchNetworks.tsx index ee7b741..df56b8a 100644 --- a/src/components/SwitchNetworks.tsx +++ b/src/components/SwitchNetworks.tsx @@ -12,12 +12,15 @@ const SwitchNetworks: React.FC = () => { const { network } = useParams<{ network?: string }>(); return ( -