about summary refs log tree commit diff
path: root/app/assets/javascripts/components/features/account
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-22 20:58:35 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-22 20:58:35 +0200
commit2a84271e85564928c4b5e241d7d3bde69fef40ed (patch)
treec5db43d46ba3eb056e2dd786887503f5c3c23be5 /app/assets/javascripts/components/features/account
parent4a670780f0fda6891f1332e7a00c4b8f925634ed (diff)
Infinite scroll for account timelines
Diffstat (limited to 'app/assets/javascripts/components/features/account')
-rw-r--r--app/assets/javascripts/components/features/account/index.jsx32
1 files changed, 21 insertions, 11 deletions
diff --git a/app/assets/javascripts/components/features/account/index.jsx b/app/assets/javascripts/components/features/account/index.jsx
index edbc34826..46d0e5954 100644
--- a/app/assets/javascripts/components/features/account/index.jsx
+++ b/app/assets/javascripts/components/features/account/index.jsx
@@ -1,13 +1,19 @@
-import { connect }                                                            from 'react-redux';
-import PureRenderMixin                                                        from 'react-addons-pure-render-mixin';
-import ImmutablePropTypes                                                     from 'react-immutable-proptypes';
-import { fetchAccount, followAccount, unfollowAccount, fetchAccountTimeline } from '../../actions/accounts';
-import { replyCompose }                                                       from '../../actions/compose';
-import { favourite, reblog }                                                  from '../../actions/interactions';
-import Header                                                                 from './components/header';
-import { selectStatus }                                                       from '../../reducers/timelines';
-import StatusList                                                             from '../../components/status_list';
-import Immutable                                                              from 'immutable';
+import { connect }           from 'react-redux';
+import PureRenderMixin       from 'react-addons-pure-render-mixin';
+import ImmutablePropTypes    from 'react-immutable-proptypes';
+import {
+  fetchAccount,
+  followAccount,
+  unfollowAccount,
+  fetchAccountTimeline,
+  expandAccountTimeline
+}                            from '../../actions/accounts';
+import { replyCompose }      from '../../actions/compose';
+import { favourite, reblog } from '../../actions/interactions';
+import Header                from './components/header';
+import { selectStatus }      from '../../reducers/timelines';
+import StatusList            from '../../components/status_list';
+import Immutable             from 'immutable';
 
 function selectAccount(state, id) {
   return state.getIn(['timelines', 'accounts', id], null);
@@ -65,6 +71,10 @@ const Account = React.createClass({
     this.props.dispatch(favourite(status));
   },
 
+  handleScrollToBottom () {
+    this.props.dispatch(expandAccountTimeline(this.props.account.get('id')));
+  },
+
   render () {
     const { account, statuses } = this.props;
 
@@ -75,7 +85,7 @@ const Account = React.createClass({
     return (
       <div style={{ display: 'flex', flexDirection: 'column', 'flex': '0 0 auto', height: '100%' }}>
         <Header account={account} onFollow={this.handleFollow} onUnfollow={this.handleUnfollow} />
-        <StatusList statuses={statuses} onReply={this.handleReply} onReblog={this.handleReblog} onFavourite={this.handleFavourite} />
+        <StatusList statuses={statuses} onScrollToBottom={this.handleScrollToBottom} onReply={this.handleReply} onReblog={this.handleReblog} onFavourite={this.handleFavourite} />
       </div>
     );
   }