@@ -5,7 +5,7 @@ import { Link } from 'react-router-dom'
55import { Col , Row , Button , Badge , Switch } from 'antd'
66import { WalletContext } from 'contexts/wallet-context'
77import { TourContext } from 'contexts/tour-context'
8- import { NETWORK_NAME , NETWORK_COLOR , NETWORK } from 'utils/network-utils '
8+ import { NETWORKS , NETWORKS_INFO } from '../../config/networks '
99import Identicon from 'components/identicon'
1010import Notifications from 'components/notifications'
1111import { ReactComponent as Logo } from 'assets/images/logo.svg'
@@ -107,17 +107,17 @@ const AppBar = () => {
107107 const [ requestedChain , setRequestedChain ] = useState ( )
108108 const nextNetworkTCR = getNetworkEnv (
109109 'REACT_APP_DEFAULT_TCR_ADDRESSES' ,
110- networkId === NETWORK . XDAI ? NETWORK . MAINNET : NETWORK . XDAI
110+ networkId === NETWORKS . xDai ? NETWORKS . ethereum : NETWORKS . xDai
111111 )
112112 const currentChainId = useMemo ( ( ) => requestedChain ?? networkId , [
113113 networkId ,
114114 requestedChain
115115 ] )
116116
117117 const switchChain = useCallback ( ( ) => {
118- let nextNetwork = NETWORK . XDAI
119- if ( networkId === NETWORK . XDAI ) nextNetwork = NETWORK . MAINNET
120- else nextNetwork = NETWORK . XDAI
118+ let nextNetwork = NETWORKS . xDai
119+ if ( networkId === NETWORKS . xDai ) nextNetwork = NETWORKS . ethereum
120+ else nextNetwork = NETWORKS . xDai
121121
122122 setRequestedChain ( nextNetwork )
123123 localStorage . setItem ( SAVED_NETWORK_KEY , nextNetwork )
@@ -143,14 +143,16 @@ const AppBar = () => {
143143 web3Context . networkId &&
144144 ( account ? (
145145 < StyledNetworkStatus >
146- < Badge color = { NETWORK_COLOR [ web3Context . networkId ] } />
147- { capitalizeFirstLetter ( NETWORK_NAME [ web3Context . networkId ] ) }
146+ < Badge color = { NETWORKS_INFO [ web3Context . networkId ] . color } />
147+ { capitalizeFirstLetter (
148+ NETWORKS_INFO [ web3Context . networkId ] . name
149+ ) }
148150 </ StyledNetworkStatus >
149151 ) : (
150152 < Switch
151153 checkedChildren = "xDai"
152154 unCheckedChildren = "Mainnet"
153- checked = { currentChainId === NETWORK . XDAI }
155+ checked = { currentChainId === NETWORKS . xDai }
154156 onClick = { switchChain }
155157 />
156158 ) ) }
0 commit comments