mirror of
https://github.com/wassname/talk.git
synced 2026-07-01 20:58:45 +08:00
40 lines
1003 B
JavaScript
40 lines
1003 B
JavaScript
import {compose, gql} from 'react-apollo';
|
|
import UserFlagDetails from '../components/UserFlagDetails';
|
|
import {bindActionCreators} from 'redux';
|
|
import {withFragments, excludeIf} from 'plugin-api/beta/client/hocs';
|
|
import {viewUserDetail} from 'plugin-api/beta/client/actions/admin';
|
|
import {connect} from 'react-redux';
|
|
|
|
const mapDispatchToProps = (dispatch) => ({
|
|
...bindActionCreators({
|
|
viewUserDetail,
|
|
}, dispatch)
|
|
});
|
|
|
|
const enhance = compose(
|
|
connect(null, mapDispatchToProps),
|
|
withFragments({
|
|
comment: gql`
|
|
fragment CoralAdmin_UserFlagDetails_comment on Comment {
|
|
actions {
|
|
__typename
|
|
... on FlagAction {
|
|
id
|
|
reason
|
|
message
|
|
user {
|
|
id
|
|
username
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
}),
|
|
excludeIf(({comment: {actions}}) =>
|
|
!actions.some((action) => action.__typename === 'FlagAction' && action.user
|
|
)),
|
|
);
|
|
|
|
export default enhance(UserFlagDetails);
|