Adding POST /api/v1/reports API, and a UI for submitting reports
This commit is contained in:
parent
40a4053732
commit
3b81baaaaf
26 changed files with 480 additions and 10 deletions
|
@ -13,7 +13,8 @@ const Header = React.createClass({
|
|||
me: React.PropTypes.number.isRequired,
|
||||
onFollow: React.PropTypes.func.isRequired,
|
||||
onBlock: React.PropTypes.func.isRequired,
|
||||
onMention: React.PropTypes.func.isRequired
|
||||
onMention: React.PropTypes.func.isRequired,
|
||||
onReport: React.PropTypes.func.isRequired
|
||||
},
|
||||
|
||||
mixins: [PureRenderMixin],
|
||||
|
@ -30,6 +31,11 @@ const Header = React.createClass({
|
|||
this.props.onMention(this.props.account, this.context.router);
|
||||
},
|
||||
|
||||
handleReport () {
|
||||
this.props.onReport(this.props.account);
|
||||
this.context.router.push('/report');
|
||||
},
|
||||
|
||||
render () {
|
||||
const { account, me } = this.props;
|
||||
|
||||
|
@ -50,6 +56,7 @@ const Header = React.createClass({
|
|||
me={me}
|
||||
onBlock={this.handleBlock}
|
||||
onMention={this.handleMention}
|
||||
onReport={this.handleReport}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
unblockAccount
|
||||
} from '../../../actions/accounts';
|
||||
import { mentionCompose } from '../../../actions/compose';
|
||||
import { initReport } from '../../../actions/reports';
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const getAccount = makeGetAccount();
|
||||
|
@ -39,6 +40,10 @@ const mapDispatchToProps = dispatch => ({
|
|||
|
||||
onMention (account, router) {
|
||||
dispatch(mentionCompose(account, router));
|
||||
},
|
||||
|
||||
onReport (account) {
|
||||
dispatch(initReport(account));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue