kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
TimelineQueueButtonHeader: always scroll to top
rodzic
4840a3c751
commit
38b41ced76
|
@ -82,7 +82,6 @@ export default class StatusList extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDequeueTimeline = () => {
|
handleDequeueTimeline = () => {
|
||||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
||||||
const { onDequeueTimeline, timelineId } = this.props;
|
const { onDequeueTimeline, timelineId } = this.props;
|
||||||
if (!onDequeueTimeline || !timelineId) return;
|
if (!onDequeueTimeline || !timelineId) return;
|
||||||
onDequeueTimeline(timelineId);
|
onDequeueTimeline(timelineId);
|
||||||
|
|
|
@ -55,8 +55,13 @@ class TimelineQueueButtonHeader extends React.PureComponent {
|
||||||
}
|
}
|
||||||
}, 150, { trailing: true });
|
}, 150, { trailing: true });
|
||||||
|
|
||||||
|
handleClick = e => {
|
||||||
|
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
this.props.onClick(e);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { count, message, onClick, intl } = this.props;
|
const { count, message, intl } = this.props;
|
||||||
const { scrolled } = this.state;
|
const { scrolled } = this.state;
|
||||||
|
|
||||||
const visible = count > 0 && scrolled;
|
const visible = count > 0 && scrolled;
|
||||||
|
@ -67,7 +72,7 @@ class TimelineQueueButtonHeader extends React.PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes}>
|
<div className={classes}>
|
||||||
<a className='timeline-queue-header__btn' onClick={onClick}>
|
<a className='timeline-queue-header__btn' onClick={this.handleClick}>
|
||||||
<Icon src={require('@tabler/icons/icons/arrow-bar-to-up.svg')} />
|
<Icon src={require('@tabler/icons/icons/arrow-bar-to-up.svg')} />
|
||||||
{(count > 0) && (
|
{(count > 0) && (
|
||||||
<div className='timeline-queue-header__label'>
|
<div className='timeline-queue-header__label'>
|
||||||
|
|
Ładowanie…
Reference in New Issue