From 34d3e885b877e31126a6f149f21d01e1d83a37b3 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Thu, 29 Mar 2018 11:32:35 +0200 Subject: [PATCH] fixed account tab underline when resize window --- src/js/components/wallet/account/AccountTabs.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/js/components/wallet/account/AccountTabs.js b/src/js/components/wallet/account/AccountTabs.js index a4a8d41a..55ba8799 100644 --- a/src/js/components/wallet/account/AccountTabs.js +++ b/src/js/components/wallet/account/AccountTabs.js @@ -22,10 +22,21 @@ class Indicator extends Component { left: 0 }, } + + this.reposition = this.reposition.bind(this); + } + + handleResize() { + this.reposition(); } componentDidMount() { this.reposition(); + window.addEventListener('resize', this.reposition, false); + } + + componentWillUnmount() { + window.removeEventListener('resize', this.reposition, false); } componentDidUpdate(newProps: any) { @@ -47,7 +58,6 @@ class Indicator extends Component { } }) } - } render() {