uniswap-interface-uncensored/src/index.tsx

79 lines
2.4 KiB
TypeScript
Raw Normal View History

import '@reach/dialog/styles.css'
import 'inter-ui'
import 'polyfills'
import 'components/analytics'
import { FeatureFlagsProvider } from 'featureFlags'
import RelayEnvironment from 'graphql/data/RelayEnvironment'
import { BlockNumberProvider } from 'lib/hooks/useBlockNumber'
import { MulticallUpdater } from 'lib/state/multicall'
import { StrictMode } from 'react'
chore: upgrade to react 18 (#3992) * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix: revert to prev commmit * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * fix: rebase * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * fix * fix: error boundary change * yarn.lock change * fix: cypress tests finally passing due to zzmp redux multicall fix HOORAY * undo service worker changes * build: dedup lockfile * yarn.lock + lint * update snapshot tests * checkpoint * yarn.lock * fix: fix type errors during build * fixes * fix yarn.lock * dedup yarn * fix: import react components explicitly instead of all of react * dedup * yarn.lock * yarn.lock * dedup * yarn * dedup * dedupe use-sync-external-store * fix build issues * dedup use-sync-external-store Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2022-07-13 23:56:09 +03:00
import { createRoot } from 'react-dom/client'
import { QueryClient, QueryClientProvider } from 'react-query'
import { Provider } from 'react-redux'
import { RelayEnvironmentProvider } from 'react-relay'
2020-09-24 19:18:57 +03:00
import { HashRouter } from 'react-router-dom'
feat: upgrade to web3-react v8 (#3759) * initial * comment more stuff out for now * more changes * more temp * remove walletconnect bug logic * switch to provider not connector * remove fortmatic * remove some usage of network connector * fix initialize connector * more changes * remove switch to network * connect eagerly * active -> isActive * add initial option cards * upgrade web3-react * delete tryActivation * delete pending view, reset option code * fix hooks * library -> provider * rm getLibrary * eagerly connect * comment all this code for now * add back app * dont connect eagerly here * deactivate * switchToNetwork * switch to useWeb3React * rm Web3ReactManager * add back og wallet modal code * switch back to old option logic * add account logic back * add back more network switch logic * Revert "switch to useWeb3React" This reverts commit 08ac6319d40207c31c72bf3b16b9f22223fc1ddc. * add back skip disconnect logic * check for network connector * use promise.then again * remove unnecessary pending error logic * reset useAddTokenToMetamask * upgrade packages * use watchAsset * add gnosis * rm fortmatic * close on disconnection * add Wallet enum * remove fortmatic imports * add wallet state * set/clear override wallet * resolve empty * remove some wallet modal view logic * useWeb3ReactListener * move to use effect * add setwalletoverride in deactivate for now * start to fix the wallet modal bug * back button should open options * connect eagerly to all * Revert "add setwalletoverride in deactivate for now" This reverts commit fbc990a9245c68460b1f29e368174b5327aa586c. * useSelectedIsActive * switch the enum to not be a bug * actually dispatch the wallet override * remove connection useEffect for now * Revert "remove connection useEffect for now" This reverts commit 0b92eee6894586e08079c1e4092e098b579cb768. * add back the activation useeffect * handle resetting eagerly connecting * dont disconnect from coinbase wallet * disconnect except for coinbase wallet, bc their reload breaks things * handle eager activation edge case * backfill wallet override * rename wrapper components * update test * network if override undefined * npx deduplicate * comment for why coinbase wallet special cased * connectorPrevious -> previousConnector * Array.find instead of forEach * useState instead of useReducer * add comments and simplify * Web3Wrapper component * add type guard * check for watchAsset * revert Option.tsx changes * set -> updateWalletOverride * generalize connector type usage * rm comment * eagerlyConnect comment * null -> undefined * add comment for wallet override * add back pendingError logic * merge conflicts * remove provider dep * add back connect a wallet * move active prop out of base props * add back account details test * add type of isActiveMap * add back eslint * add TODO * Web3Provider * return null from Updater * update comment * integration tests initial * try updating test * check for gnosis safe * fix gnosis safe check * pr comments * pr comments * don't eagerly connect to any wallets other than gnosis or walletOverride * remove unused branch * pendingError from hook * eslint-disable-line * try connecting to wallets if not backfilled * move eager connection logic * remove connect eagerly set logic * disconnect on change * simplify ConnectorState * better solution for changing wallet priority * merge fixes * fix tests * try fixing test again * add comment * add fortmatic back * set walletOverride for fortmatic * hide other chains * handle eager connection * connect everything eagerly if not backfilled * fix chain switching * async * rm error console * fortmatic update * log errors * don't eagerly connect to fortmatic * onSelectChain + switchChain * typo * don't disconnect from coinbase wallet for now * upgrade web3-react * close on disconnection/connection again * simplify account change check * comment fix * comment * fortmatic icon * comment for fortmatic in network selector * consolidate useEffect hooks in walletmodal for connection/disconnection * switchToChain * comment * isEagerlyConnecting instead of eagerlyConnectingWallets * update web3-react * close modal fortmatic * remove error log * chainIdNotAllowed * handle useToken * update SupportedChainId * move if statements around * move to wallet reducer * close as error * export fix * add back history change * add back popular * fortmatic key * persist wallet * remove eagerly connect * call connect eagerly * handle modal errors * handle fortmatic close properly * connector error changes * go back to options * change redux wallets * simplify reducer * fix eagerly connect / disconnect * remove account change hook * simplify connect eagerly * remove unused var * revert chain * walletOverride reducer * update web3-react * fix compile errors for now * show disconnect button * clear pending connector * clear error state * add back skip toggle check * MAINNET provider for ENS * add coinbase wallet sdk * fix test * add back style but fix syntax highlighting * dont create separate json rpc provider * don't use selected hooks * dont export * dispatch first * useConnectors * comment * simplify activeMap * useIsActiveMap * prettier * prop change * move comment * useCallback * coinbase wallet link fix * rm ModalWallet type * reportError * isChainAllowed * NETWORK_SELECTOR_CHAINS * mainnet provider * remove unused wallet views * add back default case * selected wallet * comment change * !chainAllowed * rm ensResolver * rm forEach * re-define reportError * move effects arounds * change error message for switching chain * simplify Web3Provider * delete use isActive map * fix test? * rm disconnect test for now * error message updates * const -> function * move fn * undo changes for showing connect wallet state * clear error before activating * remove special case for fortmatic error * backfillable/selectable wallets * log wallet * Revert "rm disconnect test for now" This reverts commit 225bc7dc5622ae918d8a8b70e4425c648d1a1fac. * check if account exists * unused dep * remove reload piece of test * update connect a wallet default state * headerRow
2022-06-16 21:39:23 +03:00
import Web3Provider from './components/Web3Provider'
import { LanguageProvider } from './i18n'
import App from './pages/App'
import * as serviceWorkerRegistration from './serviceWorkerRegistration'
import store from './state'
import ApplicationUpdater from './state/application/updater'
import ListsUpdater from './state/lists/updater'
import LogsUpdater from './state/logs/updater'
feat(lists): allow selecting and adding token lists (#1023) * more list stuff Use the selected list instead of the default list, but also use the default list start list selection code * move token warning to a modal, fix the install issue * add/remove/enter key * handle enter on currency select for ETHER * change slippage tolerance to be a slider * make ui closer to the mocks * commit slider changes * back to tabs * copy changes * bump list version * some styling for the list select * bump uniswap default list version * use contract calls to get ens names and addresses * show list logo * fix failing integration test * .eth.link * list introduction screen * remove showSendWithSwap * fix integration and unit tests * resolve ENS names * logos from ens * fix the lint errors * some refactoring to better support using a the library provider from the user for resolving ENS names * load list info from the list url for the introduction page * make it slightly harder to remove a list * minor clean up, some help text and links * remove icon from list update popup * show added/removed tokens * add GA everywhere, don't debounce contenthash lookups * show tags * fix tag key * tag display, list rendering, needs optimization * fix list fetching in firefox, style issue in safari * sort the lists, clean up styling * use client provider when possible * show token warning for url loaded tokens * improve the warning modal * some refactoring to fix the list fetching on networks other than mainnet * fix tests * some minor improvements * increase timeout to maybe fix integration tests which pass locally * build for tests using the dev network url * reset the lists if we deleted the other two copies * improve how we handle updating the default list of lists * fix integration test * Update token list selection styles * fix external links, reuse the on click outside code, show add errors * show the list origin instead of the full url * fix update list link * show host instead of hostname do not automatically dismiss major version upgrades for lists * fix link to tokenlists.org * add uma * clean up styling in list rows * bump token list version * bump token list version again * hover symbol to see currency name * bump version * add cmc lists, dharma list Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-08-26 16:46:21 +03:00
import TransactionUpdater from './state/transactions/updater'
import UserUpdater from './state/user/updater'
import ThemeProvider, { ThemedGlobalStyle } from './theme'
const queryClient = new QueryClient()
if (!!window.ethereum) {
window.ethereum.autoRefreshOnNetworkChange = false
}
function Updaters() {
return (
<>
<ListsUpdater />
<UserUpdater />
<ApplicationUpdater />
<TransactionUpdater />
<MulticallUpdater />
<LogsUpdater />
</>
)
}
chore: upgrade to react 18 (#3992) * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix: revert to prev commmit * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * fix: rebase * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * fix * fix: error boundary change * yarn.lock change * fix: cypress tests finally passing due to zzmp redux multicall fix HOORAY * undo service worker changes * build: dedup lockfile * yarn.lock + lint * update snapshot tests * checkpoint * yarn.lock * fix: fix type errors during build * fixes * fix yarn.lock * dedup yarn * fix: import react components explicitly instead of all of react * dedup * yarn.lock * yarn.lock * dedup * yarn * dedup * dedupe use-sync-external-store * fix build issues * dedup use-sync-external-store Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2022-07-13 23:56:09 +03:00
const container = document.getElementById('root') as HTMLElement
createRoot(container).render(
feat(lists): allow selecting and adding token lists (#1023) * more list stuff Use the selected list instead of the default list, but also use the default list start list selection code * move token warning to a modal, fix the install issue * add/remove/enter key * handle enter on currency select for ETHER * change slippage tolerance to be a slider * make ui closer to the mocks * commit slider changes * back to tabs * copy changes * bump list version * some styling for the list select * bump uniswap default list version * use contract calls to get ens names and addresses * show list logo * fix failing integration test * .eth.link * list introduction screen * remove showSendWithSwap * fix integration and unit tests * resolve ENS names * logos from ens * fix the lint errors * some refactoring to better support using a the library provider from the user for resolving ENS names * load list info from the list url for the introduction page * make it slightly harder to remove a list * minor clean up, some help text and links * remove icon from list update popup * show added/removed tokens * add GA everywhere, don't debounce contenthash lookups * show tags * fix tag key * tag display, list rendering, needs optimization * fix list fetching in firefox, style issue in safari * sort the lists, clean up styling * use client provider when possible * show token warning for url loaded tokens * improve the warning modal * some refactoring to fix the list fetching on networks other than mainnet * fix tests * some minor improvements * increase timeout to maybe fix integration tests which pass locally * build for tests using the dev network url * reset the lists if we deleted the other two copies * improve how we handle updating the default list of lists * fix integration test * Update token list selection styles * fix external links, reuse the on click outside code, show add errors * show the list origin instead of the full url * fix update list link * show host instead of hostname do not automatically dismiss major version upgrades for lists * fix link to tokenlists.org * add uma * clean up styling in list rows * bump token list version * bump token list version again * hover symbol to see currency name * bump version * add cmc lists, dharma list Co-authored-by: Callil Capuozzo <callil.capuozzo@gmail.com>
2020-08-26 16:46:21 +03:00
<StrictMode>
<Provider store={store}>
<FeatureFlagsProvider>
<QueryClientProvider client={queryClient}>
<HashRouter>
<LanguageProvider>
<Web3Provider>
<RelayEnvironmentProvider environment={RelayEnvironment}>
2022-10-19 19:47:38 +03:00
<BlockNumberProvider>
<Updaters />
<ThemeProvider>
<ThemedGlobalStyle />
<App />
</ThemeProvider>
</BlockNumberProvider>
</RelayEnvironmentProvider>
</Web3Provider>
</LanguageProvider>
</HashRouter>
</QueryClientProvider>
</FeatureFlagsProvider>
</Provider>
chore: upgrade to react 18 (#3992) * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix: revert to prev commmit * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * fix: rebase * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * rebase * rebase * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * rebase * chore: upgrade to react 18 * fix: update tests * fix: fix lint issues and remove unnecessary react hooks testing library * fix: add types for stricter typescript checks * fix: fix additional typescript check issues * fix * eslint fix * fix: package.json changes * fix: package.json changes * fix yarn lock * fix version package.json * fix: downgrade react-router-dom to original * fix: undo modification of .github/workflows/release.yaml * fix: revert cypress testing version update * fix * fix: error boundary change * yarn.lock change * fix: cypress tests finally passing due to zzmp redux multicall fix HOORAY * undo service worker changes * build: dedup lockfile * yarn.lock + lint * update snapshot tests * checkpoint * yarn.lock * fix: fix type errors during build * fixes * fix yarn.lock * dedup yarn * fix: import react components explicitly instead of all of react * dedup * yarn.lock * yarn.lock * dedup * yarn * dedup * dedupe use-sync-external-store * fix build issues * dedup use-sync-external-store Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
2022-07-13 23:56:09 +03:00
</StrictMode>
)
if (process.env.REACT_APP_SERVICE_WORKER !== 'false') {
serviceWorkerRegistration.register()
}