- 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:
Moody Salem 2020-05-20 12:12:06 -05:00
parent 206e845731
commit a10b22a382
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB
4 changed files with 16 additions and 24 deletions

5
.env

@ -1,5 +1,2 @@
REACT_APP_CHAIN_ID="1"
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"
REACT_APP_NETWORK_URL="https://mainnet.infura.io/v3/b8800ce81b8c451698081d269b86692b"

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 = "/*"
to = "/index.html"
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 { isMobile } from 'react-device-detect'
import ReactDOM from 'react-dom'
import ReactGA from 'react-ga'
import { Web3ReactProvider, createWeb3ReactRoot } from '@web3-react/core'
import { Web3Provider } from '@ethersproject/providers'
import { Provider } from 'react-redux'
import { NetworkContextName } from './constants'
import { isMobile } from 'react-device-detect'
import WalletUpdater from './state/wallet/updater'
import './i18n'
import App from './pages/App'
import store from './state'
import ApplicationUpdater from './state/application/updater'
import TransactionUpdater from './state/transactions/updater'
import UserUpdater from './state/user/updater'
import WalletUpdater from './state/wallet/updater'
import ThemeProvider, { FixedGlobalStyle, ThemedGlobalStyle } from './theme'
import './i18n'
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
function getLibrary(provider): Web3Provider {
const library = new Web3Provider(provider)
library.pollingInterval = 10000
return library
function getLibrary(provider: any): Web3Provider {
return new Web3Provider(provider)
}
if (process.env.NODE_ENV === 'production') {
ReactGA.initialize(process.env.REACT_APP_GOOGLE_ANALYTICS_ID)
const GOOGLE_ANALYTICS_ID: string | undefined = process.env.REACT_APP_GOOGLE_ANALYTICS_ID
if (typeof GOOGLE_ANALYTICS_ID === 'string') {
ReactGA.initialize(GOOGLE_ANALYTICS_ID)
ReactGA.set({
customBrowserType: !isMobile ? 'desktop' : 'web3' in window || 'ethereum' in window ? 'mobileWeb3' : 'mobileRegular'
})