1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

use connect function

This commit is contained in:
Matthias Kretschmann 2020-07-14 16:25:28 +02:00
parent c9a043adce
commit 9680468943
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -28,11 +28,9 @@ const Blockies = ({ account }: { account: string | undefined }) => {
// Forward ref for Tippy.js
// eslint-disable-next-line
const Account = React.forwardRef((props, ref: any) => {
const { accountId, status, web3Modal } = useOcean()
const { accountId, status, connect } = useOcean()
const hasSuccess = status === 1
console.log(web3Modal)
return accountId ? (
<button className={styles.button} aria-label="Account" ref={ref}>
<Blockies account={accountId} />
@ -47,7 +45,7 @@ const Account = React.forwardRef((props, ref: any) => {
) : (
<button
className={styles.button}
onClick={() => web3Modal.toggleModal()}
onClick={() => connect()}
// Need the `ref` here although we do not want
// the Tippy to show in this state.
ref={ref}