uniswap-interface-uncensored/src/index.tsx

92 lines
2.7 KiB
TypeScript
Raw Normal View History

import 'inter-ui'
import '@reach/dialog/styles.css'
import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
import { StrictMode } from 'react'
import { isMobile } from 'react-device-detect'
import ReactDOM from 'react-dom'
import ReactGA from 'react-ga'
import { Provider } from 'react-redux'
2020-09-24 19:18:57 +03:00
import { HashRouter } from 'react-router-dom'
import Blocklist from './components/Blocklist'
import { NetworkContextName } from './constants/misc'
import { LanguageProvider } from './i18n'
import App from './pages/App'
import store from './state'
import * as serviceWorkerRegistration from './serviceWorkerRegistration'
import ApplicationUpdater from './state/application/updater'
import ListsUpdater from './state/lists/updater'
import MulticallUpdater from './state/multicall/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'
import RadialGradientByChainUpdater from './theme/RadialGradientByChainUpdater'
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
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
if (!!window.ethereum) {
window.ethereum.autoRefreshOnNetworkChange = false
}
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_GOOGLE_ANALYTICS_ID
if (typeof GOOGLE_ANALYTICS_ID === 'string') {
ReactGA.initialize(GOOGLE_ANALYTICS_ID, {
gaOptions: {
storage: 'none',
storeGac: false,
},
})
ReactGA.set({
anonymizeIp: true,
2021-02-16 11:46:17 +03:00
customBrowserType: !isMobile
? 'desktop'
: 'web3' in window || 'ethereum' in window
? 'mobileWeb3'
: 'mobileRegular',
})
} else {
ReactGA.initialize('test', { testMode: true, debug: true })
2018-10-28 14:12:59 +03:00
}
function Updaters() {
return (
<>
<RadialGradientByChainUpdater />
<ListsUpdater />
<UserUpdater />
<ApplicationUpdater />
<TransactionUpdater />
<MulticallUpdater />
<LogsUpdater />
</>
)
}
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>
<Provider store={store}>
<HashRouter>
<LanguageProvider>
<Web3ReactProvider getLibrary={getLibrary}>
<Web3ProviderNetwork getLibrary={getLibrary}>
<Blocklist>
<Updaters />
<ThemeProvider>
<ThemedGlobalStyle />
<App />
</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>,
document.getElementById('root')
)
if (process.env.REACT_APP_SERVICE_WORKER !== 'false') {
serviceWorkerRegistration.register()
}