-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathBitgetWalletCard.tsx
40 lines (32 loc) · 1009 Bytes
/
BitgetWalletCard.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { useEffect, useState } from 'react'
import { hooks, bitKeep } from '../../connectors/bitgetWallet'
import { Card } from '../Card'
const { useChainId, useAccounts, useIsActivating, useIsActive, useProvider, useENSNames } = hooks
export default function BitgetWalletCard() {
const chainId = useChainId()
const accounts = useAccounts()
const isActivating = useIsActivating()
const isActive = useIsActive()
const provider = useProvider()
const ENSNames = useENSNames(provider)
const [error, setError] = useState(undefined)
// attempt to connect eagerly on mount
useEffect(() => {
void bitKeep.connectEagerly().catch(() => {
console.debug('Failed to connect eagerly to metamask')
})
}, [])
return (
<Card
connector={bitKeep}
activeChainId={chainId}
isActivating={isActivating}
isActive={isActive}
error={error}
setError={setError}
accounts={accounts}
provider={provider}
ENSNames={ENSNames}
/>
)
}