Added scroll to top on TimelineQueueButtonHeader click
• Added: - scroll to top on TimelineQueueButtonHeader click using utils/scroll_to
This commit is contained in:
parent
8204318676
commit
e87386a0cf
@ -1,6 +1,7 @@
|
|||||||
import { FormattedMessage } from 'react-intl'
|
import { FormattedMessage } from 'react-intl'
|
||||||
import classNames from 'classnames/bind'
|
import classNames from 'classnames/bind'
|
||||||
import { shortNumberFormat } from '../utils/numbers'
|
import { shortNumberFormat } from '../utils/numbers'
|
||||||
|
import { scrollTo } from '../utils/scroll_to'
|
||||||
import Button from './button'
|
import Button from './button'
|
||||||
import Text from './text'
|
import Text from './text'
|
||||||
|
|
||||||
@ -20,8 +21,14 @@ export default class TimelineQueueButtonHeader extends PureComponent {
|
|||||||
itemType: 'item',
|
itemType: 'item',
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
handleOnClick = () => {
|
||||||
const { count, itemType, onClick } = this.props
|
scrollTo(document.documentElement, 0, 500)
|
||||||
|
|
||||||
|
this.props.onClick()
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const { count, itemType } = this.props
|
||||||
|
|
||||||
const hasItems = count > 0
|
const hasItems = count > 0
|
||||||
|
|
||||||
@ -38,7 +45,7 @@ export default class TimelineQueueButtonHeader extends PureComponent {
|
|||||||
isNarrow
|
isNarrow
|
||||||
color='white'
|
color='white'
|
||||||
backgroundColor='brand'
|
backgroundColor='brand'
|
||||||
onClick={onClick}
|
onClick={this.handleOnClick}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
hasItems &&
|
hasItems &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user