diff --git a/polkaviz-app/src/components/Rectangle.js b/polkaviz-app/src/components/Rectangle.js index 2a4b3aa..95ecb4b 100644 --- a/polkaviz-app/src/components/Rectangle.js +++ b/polkaviz-app/src/components/Rectangle.js @@ -14,23 +14,24 @@ class Rectangle extends React.Component { }); document.body.style.cursor = 'pointer'; // this.setState({ showValidatorAddress: true }); - // this.props.onIntentionHover({ - // accountId: - // this.props.validatorAddress.toString().slice(0, 8) + - // '......' + - // this.props.validatorAddress.toString().slice(-8), - // backersText: this.props.nominators, - // selfText: this.props.bondvalue, - // }) + this.props.onIntentionHover({ + accountId: + this.props.validatorAddress.toString().slice(0, 8) + + '......' + + this.props.validatorAddress.toString().slice(-8), + backersText: this.props.nominators, + selfText: this.props.bondvalue, + }) // console.log("intentions info"); }; handleOnMouseOut = e => { - e.target.setAttrs({ - scaleX: 1, - scaleY: 1, - }); - document.body.style.cursor = 'default'; - this.setState({ showValidatorAddress: false }); + this.props.onIntentionMouseOut(e); + // e.target.setAttrs({ + // scaleX: 1, + // scaleY: 1, + // }); + // document.body.style.cursor = 'default'; + // this.setState({ showValidatorAddress: false }); }; handleClick = () => { document.body.style.cursor = 'default'; @@ -88,7 +89,7 @@ class Rectangle extends React.Component { { + e.target.setAttrs({ + scaleX: 1, + scaleY: 1, + }); + document.body.style.cursor = 'default'; + this.forceUpdate(); + } + onIntentionHover = (info) => { // console.log("intention info", info); //check if specific validator info's length is more than 1 @@ -315,6 +324,15 @@ class KusamaApp extends React.Component { }); } + onIntentionMouseOut = (e) => { + e.target.setAttrs({ + scaleX: 1, + scaleY: 1, + }); + document.body.style.cursor = 'default'; + this.forceUpdate(); + } + render() { // TODO: Remove not in use variables/contants const commonWidth = window.innerWidth + 300; @@ -406,6 +424,7 @@ class KusamaApp extends React.Component { ); diff --git a/polkaviz-app/src/components/kusama/KusamaRectangle.js b/polkaviz-app/src/components/kusama/KusamaRectangle.js index 0f5a0ab..0e07aac 100644 --- a/polkaviz-app/src/components/kusama/KusamaRectangle.js +++ b/polkaviz-app/src/components/kusama/KusamaRectangle.js @@ -87,8 +87,8 @@ class Rectangle extends React.Component { { + if(!this.props.isMainWrapper){ + this.props.onValidatorMouseOut(e); + } + } } - // onClick={this.handleClick} /> {this.state.showValidatorAddress && !this.props.isMainWrapper && ( diff --git a/polkaviz-app/src/components/kusama/KusamaValidators.js b/polkaviz-app/src/components/kusama/KusamaValidators.js index 1683a25..c505938 100644 --- a/polkaviz-app/src/components/kusama/KusamaValidators.js +++ b/polkaviz-app/src/components/kusama/KusamaValidators.js @@ -130,6 +130,7 @@ class Validator extends React.Component { nominatorsStake={nominatorsStake} accountIndex={this.props.accountIndex} onValidatorHover={this.props.onValidatorHover} + onValidatorMouseOut={this.props.onValidatorMouseOut} /> );