mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
disable walletconnect, metamask download fallback (#183)
This commit is contained in:
parent
d5c217dc46
commit
2063f594f6
@ -25,11 +25,15 @@ const Blockies = ({ account }: { account: string | undefined }) => {
|
|||||||
const Account = React.forwardRef((props, ref: any) => {
|
const Account = React.forwardRef((props, ref: any) => {
|
||||||
const { accountId, status, connect, networkId } = useOcean()
|
const { accountId, status, connect, networkId } = useOcean()
|
||||||
const hasSuccess = status === 1 && networkId === 1
|
const hasSuccess = status === 1 && networkId === 1
|
||||||
|
const canHandleWeb3 = window?.web3 || window?.ethereum
|
||||||
|
|
||||||
async function handleActivation(e: FormEvent<HTMLButtonElement>) {
|
async function handleActivation(e: FormEvent<HTMLButtonElement>) {
|
||||||
// prevent accidentially submitting a form the button might be in
|
// prevent accidentially submitting a form the button might be in
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
await connect()
|
|
||||||
|
canHandleWeb3
|
||||||
|
? await connect()
|
||||||
|
: (location.href = 'https://metamask.io/download.html')
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent accidentially submitting a form the button might be in
|
// prevent accidentially submitting a form the button might be in
|
||||||
@ -61,7 +65,7 @@ const Account = React.forwardRef((props, ref: any) => {
|
|||||||
// the Tippy to show in this state.
|
// the Tippy to show in this state.
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
Connect Wallet
|
{canHandleWeb3 ? 'Connect Wallet' : 'Get MetaMask'}
|
||||||
</button>
|
</button>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { infuraProjectId, network } from '../../app.config'
|
import { infuraProjectId, network } from '../../app.config'
|
||||||
import WalletConnectProvider from '@walletconnect/web3-provider'
|
// import WalletConnectProvider from '@walletconnect/web3-provider'
|
||||||
// import Torus from '@toruslabs/torus-embed'
|
// import Torus from '@toruslabs/torus-embed'
|
||||||
|
|
||||||
const web3ModalTheme = {
|
const web3ModalTheme = {
|
||||||
@ -11,12 +11,12 @@ const web3ModalTheme = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const providerOptions = {
|
const providerOptions = {
|
||||||
walletconnect: {
|
// walletconnect: {
|
||||||
package: WalletConnectProvider,
|
// package: WalletConnectProvider,
|
||||||
options: {
|
// options: {
|
||||||
infuraId: infuraProjectId
|
// infuraId: infuraProjectId
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// torus: {
|
// torus: {
|
||||||
// package: Torus,
|
// package: Torus,
|
||||||
// options: {
|
// options: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user