Added scroll to top on TimelineQueueButtonHeader click

• Added:
- scroll to top on TimelineQueueButtonHeader click using utils/scroll_to
This commit is contained in:
mgabdev 2020-05-15 16:31:38 -04:00
parent 8204318676
commit e87386a0cf

View File

@ -1,6 +1,7 @@
import { FormattedMessage } from 'react-intl'
import classNames from 'classnames/bind'
import { shortNumberFormat } from '../utils/numbers'
import { scrollTo } from '../utils/scroll_to'
import Button from './button'
import Text from './text'
@ -20,8 +21,14 @@ export default class TimelineQueueButtonHeader extends PureComponent {
itemType: 'item',
}
render () {
const { count, itemType, onClick } = this.props
handleOnClick = () => {
scrollTo(document.documentElement, 0, 500)
this.props.onClick()
}
render() {
const { count, itemType } = this.props
const hasItems = count > 0
@ -38,7 +45,7 @@ export default class TimelineQueueButtonHeader extends PureComponent {
isNarrow
color='white'
backgroundColor='brand'
onClick={onClick}
onClick={this.handleOnClick}
>
{
hasItems &&