Gaëtan Renaudeau
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
2 deletions
-
src/components/ExchangePage/index.js
-
src/components/StickyBackToTop.js
|
@ -41,7 +41,7 @@ class ExchangePage extends PureComponent<Props> { |
|
|
] |
|
|
] |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Box> |
|
|
<Box pb={6}> |
|
|
<Box ff="Museo Sans|Regular" color="dark" fontSize={7} mb={5}> |
|
|
<Box ff="Museo Sans|Regular" color="dark" fontSize={7} mb={5}> |
|
|
{t('app:exchange.title')} |
|
|
{t('app:exchange.title')} |
|
|
</Box> |
|
|
</Box> |
|
|
|
@ -49,6 +49,7 @@ class StickyBackToTop extends PureComponent<Props, State> { |
|
|
const { scrollContainer } = this.props.getGrowScroll() |
|
|
const { scrollContainer } = this.props.getGrowScroll() |
|
|
if (scrollContainer) { |
|
|
if (scrollContainer) { |
|
|
const listener = () => { |
|
|
const listener = () => { |
|
|
|
|
|
if (this._unmounted) return |
|
|
const { scrollTop } = scrollContainer |
|
|
const { scrollTop } = scrollContainer |
|
|
const visible = scrollTop > this.props.scrollThreshold |
|
|
const visible = scrollTop > this.props.scrollThreshold |
|
|
this.setState(previous => { |
|
|
this.setState(previous => { |
|
@ -59,11 +60,12 @@ class StickyBackToTop extends PureComponent<Props, State> { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
scrollContainer.addEventListener('scroll', listener) |
|
|
scrollContainer.addEventListener('scroll', listener) |
|
|
this.releaseListener = () => scrollContainer.addEventListener('scroll', listener) |
|
|
this.releaseListener = () => scrollContainer.removeEventListener('scroll', listener) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
componentWillUnmount() { |
|
|
componentWillUnmount() { |
|
|
|
|
|
this._unmounted = true |
|
|
this.releaseListener() |
|
|
this.releaseListener() |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|