From 611d9734f8b7ec24e90e96e438731f5db97481f0 Mon Sep 17 00:00:00 2001 From: Connor Bryan Date: Fri, 16 Nov 2018 14:22:58 -0600 Subject: [PATCH] Release 1.4.2.1 --- .../WalletDecrypt/components/WalletButton.tsx | 67 ++++++++++--------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/common/components/WalletDecrypt/components/WalletButton.tsx b/common/components/WalletDecrypt/components/WalletButton.tsx index 1975ff53b01..8158b0aa892 100644 --- a/common/components/WalletDecrypt/components/WalletButton.tsx +++ b/common/components/WalletDecrypt/components/WalletButton.tsx @@ -31,17 +31,9 @@ interface Icon { arialabel: string; } -interface State { - hoveringIcon: string | null; -} - type Props = OwnProps & StateProps; -export class WalletButton extends React.PureComponent { - public state = { - hoveringIcon: null - }; - +export class WalletButton extends React.PureComponent { public render() { const { name, @@ -115,25 +107,40 @@ export class WalletButton extends React.PureComponent { )}
- {icons.map(i => ( - this.setHoveringIcon(i.icon)} - onMouseLeave={this.clearHoveringIcon} - > - {i.href ? ( - - - - ) : ( - - )} - {!isDisabled && - this.state.hoveringIcon === i.icon && {i.tooltip}} - - ))} + {icons.map(i => { + const IconWrapper = (props: any) => { + if (isDisabled) { + return {props.children}; + } + + if (i.href) { + return ( + + {props.children} + + ); + } + + return props.children; + }; + + return ( + + + + + {!isDisabled && {i.tooltip}} + + ); + })}
@@ -142,10 +149,6 @@ export class WalletButton extends React.PureComponent { ); } - private setHoveringIcon = (hoveringIcon: string | null) => this.setState({ hoveringIcon }); - - private clearHoveringIcon = () => this.setHoveringIcon(null); - private handleClick = () => { if (this.props.isDisabled || this.props.isFormatDisabled) { return;