2021-06-01 05:10:36 +03:00
|
|
|
import './index.css'
|
2020-05-20 20:12:06 +03:00
|
|
|
import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
|
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 React, { StrictMode } from 'react'
|
2020-05-20 20:12:06 +03:00
|
|
|
import { isMobile } from 'react-device-detect'
|
2019-04-15 19:56:40 +03:00
|
|
|
import ReactDOM from 'react-dom'
|
|
|
|
import ReactGA from 'react-ga'
|
2020-05-12 01:23:01 +03:00
|
|
|
import { Provider } from 'react-redux'
|
2020-09-24 19:18:57 +03:00
|
|
|
import { HashRouter } from 'react-router-dom'
|
2020-12-09 00:11:42 +03:00
|
|
|
import Blocklist from './components/Blocklist'
|
2021-05-18 18:31:22 +03:00
|
|
|
import { NetworkContextName } from './constants/misc'
|
2021-05-26 23:34:52 +03:00
|
|
|
import { LanguageProvider } from './i18n'
|
2019-04-15 19:56:40 +03:00
|
|
|
import App from './pages/App'
|
2020-05-12 01:23:01 +03:00
|
|
|
import store from './state'
|
2021-02-18 21:10:53 +03:00
|
|
|
import * as serviceWorkerRegistration from './serviceWorkerRegistration'
|
2020-05-13 19:58:20 +03:00
|
|
|
import ApplicationUpdater from './state/application/updater'
|
2020-07-25 18:41:03 +03:00
|
|
|
import ListsUpdater from './state/lists/updater'
|
2020-05-29 04:17:45 +03:00
|
|
|
import MulticallUpdater from './state/multicall/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'
|
2021-06-01 05:10:36 +03:00
|
|
|
import ThemeProvider, { ThemedGlobalStyle } from './theme'
|
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 getLibrary from './utils/getLibrary'
|
2018-03-11 08:50:54 +03:00
|
|
|
|
2019-11-26 01:56:31 +03:00
|
|
|
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
|
|
|
|
|
2021-02-01 18:44:47 +03:00
|
|
|
if (!!window.ethereum) {
|
|
|
|
window.ethereum.autoRefreshOnNetworkChange = false
|
2020-07-25 18:41:03 +03:00
|
|
|
}
|
|
|
|
|
2020-05-20 20:12:06 +03:00
|
|
|
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_GOOGLE_ANALYTICS_ID
|
|
|
|
if (typeof GOOGLE_ANALYTICS_ID === 'string') {
|
2021-03-27 00:32:13 +03:00
|
|
|
ReactGA.initialize(GOOGLE_ANALYTICS_ID, {
|
|
|
|
gaOptions: {
|
|
|
|
storage: 'none',
|
2021-04-19 19:04:58 +03:00
|
|
|
storeGac: false,
|
|
|
|
},
|
2021-03-27 00:32:13 +03:00
|
|
|
})
|
2019-12-31 23:27:51 +03:00
|
|
|
ReactGA.set({
|
2021-03-27 00:39:53 +03:00
|
|
|
anonymizeIp: true,
|
2021-02-16 11:46:17 +03:00
|
|
|
customBrowserType: !isMobile
|
|
|
|
? 'desktop'
|
|
|
|
: 'web3' in window || 'ethereum' in window
|
|
|
|
? 'mobileWeb3'
|
|
|
|
: 'mobileRegular',
|
2019-12-31 23:27:51 +03:00
|
|
|
})
|
2019-04-16 03:06:39 +03:00
|
|
|
} else {
|
2020-05-07 21:36:26 +03:00
|
|
|
ReactGA.initialize('test', { testMode: true, debug: true })
|
2018-10-28 14:12:59 +03:00
|
|
|
}
|
2019-12-31 23:27:51 +03:00
|
|
|
|
2019-05-03 23:37:59 +03:00
|
|
|
function Updaters() {
|
|
|
|
return (
|
|
|
|
<>
|
2020-07-25 18:41:03 +03:00
|
|
|
<ListsUpdater />
|
2020-05-13 19:58:20 +03:00
|
|
|
<UserUpdater />
|
|
|
|
<ApplicationUpdater />
|
|
|
|
<TransactionUpdater />
|
2020-05-29 04:17:45 +03:00
|
|
|
<MulticallUpdater />
|
2019-05-03 23:37:59 +03:00
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2019-04-16 03:06:39 +03:00
|
|
|
ReactDOM.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>
|
2021-05-28 19:03:53 +03:00
|
|
|
<Provider store={store}>
|
|
|
|
<HashRouter>
|
|
|
|
<LanguageProvider>
|
|
|
|
<Web3ReactProvider getLibrary={getLibrary}>
|
|
|
|
<Web3ProviderNetwork getLibrary={getLibrary}>
|
|
|
|
<Blocklist>
|
|
|
|
<Updaters />
|
|
|
|
<ThemeProvider>
|
|
|
|
<ThemedGlobalStyle />
|
2021-05-26 23:34:52 +03:00
|
|
|
<App />
|
2021-05-28 19:03:53 +03:00
|
|
|
</ThemeProvider>
|
|
|
|
</Blocklist>
|
|
|
|
</Web3ProviderNetwork>
|
|
|
|
</Web3ReactProvider>
|
|
|
|
</LanguageProvider>
|
|
|
|
</HashRouter>
|
|
|
|
</Provider>
|
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>,
|
2019-04-16 03:06:39 +03:00
|
|
|
document.getElementById('root')
|
|
|
|
)
|
2021-02-18 21:10:53 +03:00
|
|
|
|
2021-02-18 21:34:31 +03:00
|
|
|
serviceWorkerRegistration.unregister()
|