]>
cat aescling's git repositories - mastodon.git/blob - app/javascript/mastodon/features/account_timeline/components/header.js
1 import React
from 'react';
2 import ImmutablePropTypes
from 'react-immutable-proptypes';
3 import PropTypes
from 'prop-types';
4 import InnerHeader
from '../../account/components/header';
5 import ActionBar
from '../../account/components/action_bar';
6 import MissingIndicator
from '../../../components/missing_indicator';
7 import ImmutablePureComponent
from 'react-immutable-pure-component';
9 class Header
extends ImmutablePureComponent
{
12 account: ImmutablePropTypes
.map
,
13 me: PropTypes
.number
.isRequired
,
14 onFollow: PropTypes
.func
.isRequired
,
15 onBlock: PropTypes
.func
.isRequired
,
16 onMention: PropTypes
.func
.isRequired
,
17 onReport: PropTypes
.func
.isRequired
,
18 onMute: PropTypes
.func
.isRequired
,
19 onBlockDomain: PropTypes
.func
.isRequired
,
20 onUnblockDomain: PropTypes
.func
.isRequired
,
23 static contextTypes
= {
24 router: PropTypes
.object
,
27 handleFollow
= () => {
28 this.props
.onFollow(this.props
.account
);
32 this.props
.onBlock(this.props
.account
);
35 handleMention
= () => {
36 this.props
.onMention(this.props
.account
, this.context
.router
);
39 handleReport
= () => {
40 this.props
.onReport(this.props
.account
);
41 this.context
.router
.push('/report');
45 this.props
.onMute(this.props
.account
);
48 handleBlockDomain
= () => {
49 const domain
= this.props
.account
.get('acct').split('@')[1];
53 this.props
.onBlockDomain(domain
, this.props
.account
.get('id'));
56 handleUnblockDomain
= () => {
57 const domain
= this.props
.account
.get('acct').split('@')[1];
61 this.props
.onUnblockDomain(domain
, this.props
.account
.get('id'));
65 const { account
, me
} = this.props
;
67 if (account
=== null) {
68 return <MissingIndicator
/>;
72 <div className
='account-timeline__header'>
76 onFollow
={this.handleFollow
}
82 onBlock
={this.handleBlock
}
83 onMention
={this.handleMention
}
84 onReport
={this.handleReport
}
85 onMute
={this.handleMute
}
86 onBlockDomain
={this.handleBlockDomain
}
87 onUnblockDomain
={this.handleUnblockDomain
}
95 export default Header
;
This page took 0.089234 seconds and 5 git commands to generate.