diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-30 21:40:55 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-01-30 21:44:11 +0100 |
commit | f21e7d6ac06556671c2663ce2879442c60230b32 (patch) | |
tree | 68260b8383038daf6f315093064a2dbdd7b3944b /app/assets/javascripts/components/features/followers | |
parent | a2a85e85491110461cbc938abd0f2687f0e51612 (diff) |
Make profile header scroll along with contents. AccountTimeline, Followers and Following are no longer
nested inside a common parent (<Account>), instead they all embed <HeaderContainer />
Diffstat (limited to 'app/assets/javascripts/components/features/followers')
-rw-r--r-- | app/assets/javascripts/components/features/followers/index.jsx | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/app/assets/javascripts/components/features/followers/index.jsx b/app/assets/javascripts/components/features/followers/index.jsx index 38755d862..b96516813 100644 --- a/app/assets/javascripts/components/features/followers/index.jsx +++ b/app/assets/javascripts/components/features/followers/index.jsx @@ -8,6 +8,10 @@ import { } from '../../actions/accounts'; import { ScrollContainer } from 'react-router-scroll'; import AccountContainer from '../../containers/account_container'; +import Column from '../ui/components/column'; +import HeaderContainer from '../account_timeline/containers/header_container'; +import LoadMore from '../../components/load_more'; +import ColumnBackButton from '../../components/column_back_button'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'items']) @@ -41,21 +45,35 @@ const Followers = React.createClass({ } }, + handleLoadMore (e) { + e.preventDefault(); + this.props.dispatch(expandFollowing(Number(this.props.params.accountId))); + }, + render () { const { accountIds } = this.props; if (!accountIds) { - return <LoadingIndicator />; + return ( + <Column> + <LoadingIndicator /> + </Column> + ); } return ( - <ScrollContainer scrollKey='followers'> - <div className='scrollable' onScroll={this.handleScroll}> - <div> - {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)} + <Column> + <ColumnBackButton /> + <ScrollContainer scrollKey='followers'> + <div className='scrollable' onScroll={this.handleScroll}> + <div> + <HeaderContainer accountId={this.props.params.accountId} /> + {accountIds.map(id => <AccountContainer key={id} id={id} withNote={false} />)} + <LoadMore onClick={this.handleLoadMore} /> + </div> </div> - </div> - </ScrollContainer> + </ScrollContainer> + </Column> ); } |