1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

popover fixes

This commit is contained in:
Matthias Kretschmann 2019-02-26 13:32:47 -03:00
parent a50a700c92
commit db90d7cb5a
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 23 additions and 5 deletions

View File

@ -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 =>

View File

@ -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 =>

View File

@ -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>