mirror of
https://github.com/wassname/talk.git
synced 2026-07-03 11:28:25 +08:00
Working indicators
This commit is contained in:
@@ -35,7 +35,7 @@ const CoralHeader = ({
|
||||
to="/admin/moderate"
|
||||
activeClassName={styles.active}>
|
||||
{t('configure.moderate')}
|
||||
<Indicator />
|
||||
{(root.premodCount !== 0 || root.reportedCount !== 0) && <Indicator />}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import {gql} from 'react-apollo';
|
||||
import withFragments from 'coral-framework/hocs/withFragments';
|
||||
import Header from '../components/ui/Header';
|
||||
|
||||
export default withFragments({
|
||||
root: gql`
|
||||
fragment TalkAdmin_Header on RootQuery {
|
||||
premodCount: commentCount(query: {statuses: [PREMOD]})
|
||||
reportedCount: commentCount(query: {statuses: [NONE, PREMOD, SYSTEM_WITHHELD], action_type: FLAG})
|
||||
flaggedUsernamesCount: userCount(query: {
|
||||
action_type: FLAG,
|
||||
statuses: [PENDING]
|
||||
})
|
||||
}
|
||||
`
|
||||
})(Header);
|
||||
@@ -17,6 +17,7 @@ import withQuery from 'coral-framework/hocs/withQuery';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {getDefinitionName} from 'coral-framework/utils';
|
||||
import Community from '../routes/Community/containers/Community';
|
||||
import Header from '../containers/Header';
|
||||
|
||||
class LayoutContainer extends Component {
|
||||
componentWillMount() {
|
||||
@@ -105,8 +106,10 @@ LayoutContainer.propTypes = {
|
||||
|
||||
const withData = withQuery(gql`
|
||||
query TalkAdmin_initialQuery {
|
||||
...${getDefinitionName(Header.fragments.root)}
|
||||
...${getDefinitionName(Community.fragments.root)}
|
||||
}
|
||||
${Header.fragments.root}
|
||||
${Community.fragments.root}
|
||||
`, {
|
||||
options: {
|
||||
|
||||
Reference in New Issue
Block a user