uniswap-interface-uncensored/src/index.tsx
Justin Domingue c4846c8832
feat(i18n): improve i18n (#1692)
* replaced i18next with lingui

* integrate lingui in i18n and update dev setup

* updated components to @lingui

* fix compile error after rebase

* detect locale

* add all previous languages to linguirc

* address pr feedback

* remove it for now

* ignore generate *js files, various fixes

* added more translations

* fixed yarn build command

* wrapped more hardcoded english around <Trans>

* finished second round of translations

* added support for pseudo-en locale

* improvements

* moved copy.tsx to different branch

* moved extra files to different branch

* regenerated po

* clean up

* more fixes

* regenerate po

* remove messages.js

* clean up

* addressed pr feedback

* regenerated po
2021-05-26 13:34:52 -07:00

86 lines
2.5 KiB
TypeScript

import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
import 'inter-ui'
import React, { StrictMode } from 'react'
import { isMobile } from 'react-device-detect'
import ReactDOM from 'react-dom'
import ReactGA from 'react-ga'
import { Provider } from 'react-redux'
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 TransactionUpdater from './state/transactions/updater'
import UserUpdater from './state/user/updater'
import ThemeProvider, { FixedGlobalStyle, ThemedGlobalStyle } from './theme'
import getLibrary from './utils/getLibrary'
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,
customBrowserType: !isMobile
? 'desktop'
: 'web3' in window || 'ethereum' in window
? 'mobileWeb3'
: 'mobileRegular',
})
} else {
ReactGA.initialize('test', { testMode: true, debug: true })
}
function Updaters() {
return (
<>
<ListsUpdater />
<UserUpdater />
<ApplicationUpdater />
<TransactionUpdater />
<MulticallUpdater />
</>
)
}
ReactDOM.render(
<StrictMode>
<LanguageProvider>
<FixedGlobalStyle />
<Web3ReactProvider getLibrary={getLibrary}>
<Web3ProviderNetwork getLibrary={getLibrary}>
<Blocklist>
<Provider store={store}>
<Updaters />
<ThemeProvider>
<ThemedGlobalStyle />
<HashRouter>
<App />
</HashRouter>
</ThemeProvider>
</Provider>
</Blocklist>
</Web3ProviderNetwork>
</Web3ReactProvider>
</LanguageProvider>
</StrictMode>,
document.getElementById('root')
)
serviceWorkerRegistration.unregister()