mastodon/app/assets/javascripts/components/features/account_timeline/components/header.jsx
Eugen Rochko f21e7d6ac0 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 />
2017-01-30 21:44:11 +01:00

60 lines
1.3 KiB
JavaScript

import PureRenderMixin from 'react-addons-pure-render-mixin';
import ImmutablePropTypes from 'react-immutable-proptypes';
import InnerHeader from '../../account/components/header';
import ActionBar from '../../account/components/action_bar';
const Header = React.createClass({
contextTypes: {
router: React.PropTypes.object
},
propTypes: {
account: ImmutablePropTypes.map.isRequired,
me: React.PropTypes.number.isRequired,
onFollow: React.PropTypes.func.isRequired,
onBlock: React.PropTypes.func.isRequired,
onMention: React.PropTypes.func.isRequired
},
mixins: [PureRenderMixin],
handleFollow () {
this.props.onFollow(this.props.account);
},
handleBlock () {
this.props.onBlock(this.props.account);
},
handleMention () {
this.props.onMention(this.props.account, this.context.router);
},
render () {
const { account, me } = this.props;
if (!account) {
return null;
}
return (
<div>
<InnerHeader
account={account}
me={me}
onFollow={this.handleFollow}
/>
<ActionBar
account={account}
me={me}
onBlock={this.handleBlock}
onMention={this.handleMention}
/>
</div>
);
}
});
export default Header;