From 4b9ebce7d056f91135bdcbaf1fe95e0d3759b440 Mon Sep 17 00:00:00 2001 From: Vasek Mlejnsky Date: Fri, 17 Aug 2018 06:48:12 +0200 Subject: [PATCH] Fix eslint errors --- .../components/StickyContainer/index.js | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/js/views/Wallet/components/LeftNavigation/components/StickyContainer/index.js b/src/js/views/Wallet/components/LeftNavigation/components/StickyContainer/index.js index 090e3c8f..6116c04c 100644 --- a/src/js/views/Wallet/components/LeftNavigation/components/StickyContainer/index.js +++ b/src/js/views/Wallet/components/LeftNavigation/components/StickyContainer/index.js @@ -35,20 +35,12 @@ export default class StickyContainer extends React.PureComponent { subscribers = []; - handleResize = (event: Event) => { + // handleResize = (event: Event) => { - } - - handleScroll = (event: ?Event) => { - if (!this.framePending) { - this.framePending = true; - raf(this.update); - } - } + // } shouldUpdate = () => { - const wrapper: ?HTMLElement = this.wrapper; - const aside: ?HTMLElement = this.aside; + const { wrapper, aside }: {wrapper: ?HTMLElement, aside: ?HTMLElement} = this; if (!wrapper || !aside) return; const bottom: ?HTMLElement = wrapper.querySelector('.sticky-bottom'); if (!bottom) return; @@ -107,11 +99,6 @@ export default class StickyContainer extends React.PureComponent { raf(this.update); } - componentWillUnmount() { - window.removeEventListener('scroll', this.handleScroll); - window.removeEventListener('resize', this.handleScroll); - } - componentDidUpdate(prevProps: Props) { if (this.props.location !== prevProps.location && this.aside) { const asideBounds = this.aside.getBoundingClientRect(); @@ -128,6 +115,18 @@ export default class StickyContainer extends React.PureComponent { } } + componentWillUnmount() { + window.removeEventListener('scroll', this.handleScroll); + window.removeEventListener('resize', this.handleScroll); + } + + handleScroll = (/* event: ?Event */) => { + if (!this.framePending) { + this.framePending = true; + raf(this.update); + } + } + render() { return (