import React, { PureComponent } from 'react' import Account from '../../atoms/Account' import { User } from '../../../context' import styles from './Popover.module.scss' export default class Popover extends PureComponent<{ forwardedRef: (ref: HTMLElement | null) => void style: React.CSSProperties }> { public render() { const { account, balance, network, isWeb3, isOceanNetwork } = this.context return (
{!isWeb3 ? (
No Web3 detected. Use a browser with MetaMask installed to publish assets.
) : ( <>
{account && balance && (
{(balance.eth / 1e18) .toFixed(3) .slice(0, -1)} {' '} ETH {balance.ocn} OCEAN
)}
{network && !isOceanNetwork ? 'Please connect to Custom RPC\n https://pacific.oceanprotocol.com' : network && `Connected to ${network} network`}
)}
) } } Popover.contextType = User