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

activate faucet UI in popover

This commit is contained in:
Matthias Kretschmann 2019-02-26 10:56:34 -03:00
parent a38bb20bfc
commit b71649b0d0
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 7 additions and 12 deletions

View File

@ -3,6 +3,7 @@
.status { .status {
display: inline-block; display: inline-block;
position: relative; position: relative;
cursor: pointer;
} }
// default: red square // default: red square

View File

@ -1,6 +1,6 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import cx from 'classnames' import cx from 'classnames'
// import Button from '../atoms/Button' import Button from '../atoms/Button'
import { User } from '../../context/User' import { User } from '../../context/User'
import Popover from 'react-popover' import Popover from 'react-popover'
import styles from './AccountStatus.module.scss' import styles from './AccountStatus.module.scss'
@ -15,7 +15,7 @@ const AccountPopover = () => (
{states.account} {states.account}
</span> </span>
) : ( ) : (
'No account selected' <em>No account selected</em>
) )
} }
</User.Consumer> </User.Consumer>
@ -23,15 +23,15 @@ const AccountPopover = () => (
<div className={styles.popoverInfoline}> <div className={styles.popoverInfoline}>
Network: &nbsp;<strong>{''}</strong> Network: &nbsp;<strong>{''}</strong>
</div> </div>
{/* <div className={styles.popoverInfoline}> <div className={styles.popoverInfoline}>
<User.Consumer> <User.Consumer>
{states => ( {states => (
<Button link onClick={states.requestFromFaucet}> <Button link onClick={() => states.requestFromFaucet()}>
Make it rain Make it rain
</Button> </Button>
)} )}
</User.Consumer> </User.Consumer>
</div> */} </div>
</div> </div>
) )
@ -41,9 +41,6 @@ interface AccountStatusProps {
interface AccountStatusState { interface AccountStatusState {
popoverIsOpen: boolean popoverIsOpen: boolean
preferPlace?: string
place?: string
enterExitTransitionDurationMs?: number
} }
export default class AccountStatus extends PureComponent< export default class AccountStatus extends PureComponent<
@ -63,9 +60,8 @@ export default class AccountStatus extends PureComponent<
public AccountIndicator = () => ( public AccountIndicator = () => (
<div <div
className={cx(styles.status, this.props.className)} className={cx(styles.status, this.props.className)}
onClick={() => this.togglePopover(true)}
onMouseOver={() => this.togglePopover(true)} onMouseOver={() => this.togglePopover(true)}
onMouseOut={() => this.togglePopover(false)}
onTouchStart={() => this.togglePopover(true)}
> >
<User.Consumer> <User.Consumer>
{states => {states =>
@ -84,8 +80,6 @@ export default class AccountStatus extends PureComponent<
public render() { public render() {
const popoverProps = { const popoverProps = {
isOpen: this.state.popoverIsOpen, isOpen: this.state.popoverIsOpen,
// preferPlace: this.state.preferPlace,
// place: this.state.place,
enterExitTransitionDurationMs: 300, enterExitTransitionDurationMs: 300,
tipSize: 0.01, tipSize: 0.01,
onOuterAction: () => this.togglePopover(false), onOuterAction: () => this.togglePopover(false),