11import React , { useState } from 'react'
22import { useWeb3React } from '@web3-react/core'
3-
43import Dropdown from 'components/Dropdown'
54import GetOUSD from 'components/GetOUSD'
65import { isCorrectNetwork , switchEthereumChain } from 'utils/web3'
7-
86import withWalletSelectModal from 'hoc/withWalletSelectModal'
9- import analytics from 'utils/analytics'
10-
117import Content from './_AccountStatusContent'
128import AccountStatusIndicator from './_AccountStatusIndicator'
139
14- const AccountStatusDropdown = ( { className, showLogin, dapp } ) => {
10+ const AccountStatusDropdown = ( { className, showLogin } ) => {
1511 const { active, account, chainId } = useWeb3React ( )
1612 const [ open , setOpen ] = useState ( false )
1713 const correctNetwork = isCorrectNetwork ( chainId )
@@ -30,25 +26,21 @@ const AccountStatusDropdown = ({ className, showLogin, dapp }) => {
3026 } `}
3127 onClick = { async ( e ) => {
3228 e . preventDefault ( )
33- if ( dapp && ! active ) {
29+ if ( ! active ) {
3430 showLogin ( )
3531 } else if ( active && ! correctNetwork ) {
36- analytics . track ( 'On Change network' , {
37- category : 'settings' ,
38- } )
3932 // open the dropdown to allow disconnecting, while also requesting an auto switch to mainnet
4033 await switchEthereumChain ( )
4134 setOpen ( true )
42- } else if ( dapp ) {
35+ } else {
4336 setOpen ( true )
4437 }
4538 } }
4639 >
4740 { /* The button id is used by StakeBoxBig to trigger connect when no wallet connected */ }
48- { ( ( ! active && ! account ) || ( ! dapp && active && correctNetwork ) ) && (
41+ { ! active && ! account && (
4942 < GetOUSD
5043 id = "main-dapp-nav-connect-wallet-button"
51- connect = { dapp }
5244 className = "btn-nav"
5345 trackSource = "Account dropdown"
5446 />
@@ -57,7 +49,6 @@ const AccountStatusDropdown = ({ className, showLogin, dapp }) => {
5749 active = { active }
5850 correctNetwork = { correctNetwork }
5951 account = { account }
60- dapp = { dapp }
6152 withAddress
6253 />
6354 </ a >
0 commit comments