mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 03:47:59 +08:00
42 lines
938 B
JavaScript
42 lines
938 B
JavaScript
import React from 'react';
|
|
import IgnoredUserSection from '../components/IgnoredUserSection';
|
|
import { compose, gql } from 'react-apollo';
|
|
import {
|
|
withFragments,
|
|
excludeIf,
|
|
withStopIgnoringUser,
|
|
} from 'plugin-api/beta/client/hocs';
|
|
|
|
class IgnoredUserSectionContainer extends React.Component {
|
|
render() {
|
|
return (
|
|
<IgnoredUserSection
|
|
stopIgnoringUser={this.props.stopIgnoringUser}
|
|
ignoredUsers={this.props.root.me.ignoredUsers}
|
|
/>
|
|
);
|
|
}
|
|
}
|
|
|
|
const withIgnoredUserSectionFragments = withFragments({
|
|
root: gql`
|
|
fragment TalkIgnoreUser_IgnoredUserSection_root on RootQuery {
|
|
me {
|
|
id
|
|
ignoredUsers {
|
|
id
|
|
username
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
});
|
|
|
|
const enhance = compose(
|
|
withIgnoredUserSectionFragments,
|
|
withStopIgnoringUser,
|
|
excludeIf(({ root: { me } }) => me.ignoredUsers.length === 0)
|
|
);
|
|
|
|
export default enhance(IgnoredUserSectionContainer);
|