mirror of
https://github.com/oceanprotocol/commons.git
synced 2023-03-15 18:03:00 +01:00
popover fixes
This commit is contained in:
parent
a50a700c92
commit
db90d7cb5a
@ -5,15 +5,17 @@ import styles from './Indicator.module.scss'
|
||||
|
||||
const Indicator = ({
|
||||
className,
|
||||
showPopover
|
||||
showPopover,
|
||||
hidePopover
|
||||
}: {
|
||||
className?: string
|
||||
showPopover: any
|
||||
hidePopover: any
|
||||
}) => (
|
||||
<div
|
||||
className={cx(styles.status, className)}
|
||||
onClick={showPopover}
|
||||
onMouseOver={showPopover}
|
||||
onMouseOut={hidePopover}
|
||||
>
|
||||
<User.Consumer>
|
||||
{states =>
|
||||
|
@ -3,8 +3,18 @@ import { User } from '../../../context/User'
|
||||
import Faucet from './Faucet'
|
||||
import styles from './Popover.module.scss'
|
||||
|
||||
const Popover = () => (
|
||||
<div className={styles.popover}>
|
||||
const Popover = ({
|
||||
showPopover,
|
||||
hidePopover
|
||||
}: {
|
||||
showPopover: any
|
||||
hidePopover: any
|
||||
}) => (
|
||||
<div
|
||||
className={styles.popover}
|
||||
onMouseOver={showPopover}
|
||||
onMouseOut={hidePopover}
|
||||
>
|
||||
<div className={styles.accountName}>
|
||||
<User.Consumer>
|
||||
{states =>
|
||||
|
@ -31,13 +31,19 @@ export default class AccountStatus extends PureComponent<
|
||||
enterExitTransitionDurationMs: 300,
|
||||
tipSize: 0.01,
|
||||
onOuterAction: () => this.togglePopover(false),
|
||||
body: <AccountPopover />
|
||||
body: (
|
||||
<AccountPopover
|
||||
showPopover={() => this.togglePopover(true)}
|
||||
hidePopover={() => this.togglePopover(false)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Popover {...popoverProps}>
|
||||
<AccountIndicator
|
||||
showPopover={() => this.togglePopover(true)}
|
||||
hidePopover={() => this.togglePopover(false)}
|
||||
className={this.props.className}
|
||||
/>
|
||||
</Popover>
|
||||
|
Loading…
Reference in New Issue
Block a user