class ProfileColumnHeader extends React.PureComponent {
static propTypes = {
+ onClick: PropTypes.func,
intl: PropTypes.object.isRequired,
};
render() {
- const { intl } = this.props;
+ const { onClick, intl } = this.props;
return (
<ColumnHeader
icon='user-circle'
title={intl.formatMessage(messages.profile)}
+ onClick={onClick}
showBackButton
/>
);
}
}
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
handleScrollToBottom = () => {
if (this.props.hasMore) {
this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);
return !(location.state && location.state.mastodonModalOpen);
}
+ setRef = c => {
+ this.column = c;
+ }
+
render () {
const { medias, isLoading, hasMore } = this.props;
}
return (
- <Column>
- <ProfileColumnHeader />
+ <Column ref={this.setRef}>
+ <ProfileColumnHeader onClick={this.handleHeaderClick} />
<ScrollContainer scrollKey='account_gallery' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable scrollable--flex' onScroll={this.handleScroll}>
}
}
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
handleLoadMore = maxId => {
this.props.dispatch(expandAccountTimeline(this.props.params.accountId, { maxId, withReplies: this.props.withReplies }));
}
+ setRef = c => {
+ this.column = c;
+ }
+
render () {
const { statusIds, featuredStatusIds, isLoading, hasMore } = this.props;
}
return (
- <Column name='account'>
- <ProfileColumnHeader />
+ <Column ref={this.setRef} name='account'>
+ <ProfileColumnHeader onClick={this.handleHeaderClick} />
<StatusList
prepend={<HeaderContainer accountId={this.props.params.accountId} />}
}
}
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
handleScroll = (e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target;
return !(location.state && location.state.mastodonModalOpen);
}
+ setRef = c => {
+ this.column = c;
+ }
+
render () {
const { accountIds, hasMore } = this.props;
}
return (
- <Column>
- <ProfileColumnHeader />
+ <Column ref={this.setRef}>
+ <ProfileColumnHeader onClick={this.handleHeaderClick} />
<ScrollContainer scrollKey='followers' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable' onScroll={this.handleScroll}>
}
}
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
handleScroll = (e) => {
const { scrollTop, scrollHeight, clientHeight } = e.target;
return !(location.state && location.state.mastodonModalOpen);
}
+ setRef = c => {
+ this.column = c;
+ }
+
render () {
const { accountIds, hasMore } = this.props;
}
return (
- <Column>
- <ProfileColumnHeader />
+ <Column ref={this.setRef}>
+ <ProfileColumnHeader onClick={this.handleHeaderClick} />
<ScrollContainer scrollKey='following' shouldUpdateScroll={this.shouldUpdateScroll}>
<div className='scrollable' onScroll={this.handleScroll}>
}
}
+ handleHeaderClick = () => {
+ this.column.scrollTop();
+ }
+
renderChildren (list) {
return list.map(id => (
<StatusContainer
this.node = c;
}
+ setColumnRef = c => {
+ this.column = c;
+ }
+
componentDidUpdate (prevProps) {
if (this.props.params.statusId && (this.props.params.statusId !== prevProps.params.statusId || prevProps.ancestorsIds.size < this.props.ancestorsIds.size)) {
const { status, ancestorsIds } = this.props;
};
return (
- <Column label={intl.formatMessage(messages.detailedStatus)}>
+ <Column ref={this.setColumnRef} label={intl.formatMessage(messages.detailedStatus)}>
<ColumnHeader
icon='comment'
title={intl.formatMessage(messages.tootHeading)}
+ onClick={this.handleHeaderClick}
showBackButton
extraButton={(
<button className='column-header__button' title={intl.formatMessage(!isExpanded ? messages.revealAll : messages.hideAll)} aria-label={intl.formatMessage(!isExpanded ? messages.revealAll : messages.hideAll)} onClick={this.handleToggleAll} aria-pressed={!isExpanded ? 'false' : 'true'}><i className={`fa fa-${!isExpanded ? 'eye-slash' : 'eye'}`} /></button>