- Remove the environment variables from the netlify.toml in favor of create-react-app env configuration
- Remove the polling interval override in the index.tsx which is redundant with the connectors file overrides
This commit is contained in:
parent
206e845731
commit
a10b22a382
5
.env
5
.env
@ -1,5 +1,2 @@
|
|||||||
REACT_APP_CHAIN_ID="1"
|
REACT_APP_CHAIN_ID="1"
|
||||||
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/b8800ce81b8c451698081d269b86692b"
|
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/b8800ce81b8c451698081d269b86692b"
|
||||||
REACT_APP_PORTIS_ID=""
|
|
||||||
REACT_APP_FORTMATIC_KEY=""
|
|
||||||
REACT_APP_GOOGLE_ANALYTICS_ID="UA-128182339-4"
|
|
5
.env.production
Normal file
5
.env.production
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
REACT_APP_CHAIN_ID="1"
|
||||||
|
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/2acb2baa4c06402792e0c701a3697d10"
|
||||||
|
REACT_APP_PORTIS_ID="c0e2bf01-4b08-4fd5-ac7b-8e26b58cd236"
|
||||||
|
REACT_APP_FORTMATIC_KEY="pk_live_F937DF033A1666BF"
|
||||||
|
REACT_APP_GOOGLE_ANALYTICS_ID="UA-128182339-4"
|
@ -18,12 +18,3 @@
|
|||||||
from = "/*"
|
from = "/*"
|
||||||
to = "/index.html"
|
to = "/index.html"
|
||||||
status = 200
|
status = 200
|
||||||
|
|
||||||
[build.environment]
|
|
||||||
REACT_APP_NETWORK_URL = "https://mainnet.infura.io/v3/b8800ce81b8c451698081d269b86692b"
|
|
||||||
|
|
||||||
[context.production.environment]
|
|
||||||
REACT_APP_CHAIN_ID = "1"
|
|
||||||
REACT_APP_NETWORK_URL = "https://mainnet.infura.io/v3/2acb2baa4c06402792e0c701a3697d10"
|
|
||||||
REACT_APP_FORTMATIC_KEY = "pk_live_F937DF033A1666BF"
|
|
||||||
REACT_APP_PORTIS_ID = "c0e2bf01-4b08-4fd5-ac7b-8e26b58cd236"
|
|
||||||
|
@ -1,31 +1,30 @@
|
|||||||
|
import { Web3Provider } from '@ethersproject/providers'
|
||||||
|
import { createWeb3ReactRoot, Web3ReactProvider } from '@web3-react/core'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
import { isMobile } from 'react-device-detect'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import ReactGA from 'react-ga'
|
import ReactGA from 'react-ga'
|
||||||
import { Web3ReactProvider, createWeb3ReactRoot } from '@web3-react/core'
|
|
||||||
import { Web3Provider } from '@ethersproject/providers'
|
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
|
|
||||||
import { NetworkContextName } from './constants'
|
import { NetworkContextName } from './constants'
|
||||||
import { isMobile } from 'react-device-detect'
|
import './i18n'
|
||||||
import WalletUpdater from './state/wallet/updater'
|
|
||||||
import App from './pages/App'
|
import App from './pages/App'
|
||||||
import store from './state'
|
import store from './state'
|
||||||
import ApplicationUpdater from './state/application/updater'
|
import ApplicationUpdater from './state/application/updater'
|
||||||
import TransactionUpdater from './state/transactions/updater'
|
import TransactionUpdater from './state/transactions/updater'
|
||||||
import UserUpdater from './state/user/updater'
|
import UserUpdater from './state/user/updater'
|
||||||
|
import WalletUpdater from './state/wallet/updater'
|
||||||
import ThemeProvider, { FixedGlobalStyle, ThemedGlobalStyle } from './theme'
|
import ThemeProvider, { FixedGlobalStyle, ThemedGlobalStyle } from './theme'
|
||||||
import './i18n'
|
|
||||||
|
|
||||||
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
|
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
|
||||||
|
|
||||||
function getLibrary(provider): Web3Provider {
|
function getLibrary(provider: any): Web3Provider {
|
||||||
const library = new Web3Provider(provider)
|
return new Web3Provider(provider)
|
||||||
library.pollingInterval = 10000
|
|
||||||
return library
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_GOOGLE_ANALYTICS_ID
|
||||||
ReactGA.initialize(process.env.REACT_APP_GOOGLE_ANALYTICS_ID)
|
if (typeof GOOGLE_ANALYTICS_ID === 'string') {
|
||||||
|
ReactGA.initialize(GOOGLE_ANALYTICS_ID)
|
||||||
ReactGA.set({
|
ReactGA.set({
|
||||||
customBrowserType: !isMobile ? 'desktop' : 'web3' in window || 'ethereum' in window ? 'mobileWeb3' : 'mobileRegular'
|
customBrowserType: !isMobile ? 'desktop' : 'web3' in window || 'ethereum' in window ? 'mobileWeb3' : 'mobileRegular'
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user