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

Merge pull request #181 from oceanprotocol/fix/wallets-events

Stop wallet event propagation
This commit is contained in:
Jernej Pregelj 2019-07-19 12:34:01 +02:00 committed by GitHub
commit ba1ba78849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import React, { PureComponent } from 'react' import React, { PureComponent, MouseEvent } from 'react'
import Dotdotdot from 'react-dotdotdot' import Dotdotdot from 'react-dotdotdot'
import { toDataUrl } from 'ethereum-blockies' import { toDataUrl } from 'ethereum-blockies'
import styles from './Account.module.scss' import styles from './Account.module.scss'
@ -18,7 +18,8 @@ export default class Account extends PureComponent<
isAccountInfoOpen: false isAccountInfoOpen: false
} }
private toggleAccountInfo() { private toggleAccountInfo(event: MouseEvent) {
event.preventDefault()
this.setState({ isAccountInfoOpen: !this.state.isAccountInfoOpen }) this.setState({ isAccountInfoOpen: !this.state.isAccountInfoOpen })
} }
@ -61,7 +62,7 @@ export default class Account extends PureComponent<
{isBurner ? ( {isBurner ? (
<button <button
className={styles.toggle} className={styles.toggle}
onClick={() => this.toggleAccountInfo()} onClick={event => this.toggleAccountInfo(event)}
title="Show More Account Info" title="Show More Account Info"
> >
<Caret <Caret