mirror of
https://github.com/wassname/talk.git
synced 2026-07-15 11:26:58 +08:00
Reliability Added
This commit is contained in:
@@ -9,6 +9,8 @@ import {actionsMap} from '../utils/moderationQueueActionsMap';
|
||||
import ClickOutside from 'coral-framework/components/ClickOutside';
|
||||
import LoadMore from '../components/LoadMore';
|
||||
import cn from 'classnames';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
import {getReliability} from 'coral-framework/utils/user';
|
||||
|
||||
export default class UserDetail extends React.Component {
|
||||
|
||||
@@ -116,7 +118,9 @@ export default class UserDetail extends React.Component {
|
||||
</li>
|
||||
<li className={styles.stat}>
|
||||
<spam className={styles.statItem}> Reports </spam>
|
||||
<spam className={cn(styles.statReportResult, styles['reliable'])}>Reliable</spam>
|
||||
<spam className={cn(styles.statReportResult, styles[getReliability(user.reliable.flagger)])}>
|
||||
{capitalize(getReliability(user.reliable.flagger))}
|
||||
</spam>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -142,6 +142,9 @@ export const withUserDetailQuery = withQuery(gql`
|
||||
id
|
||||
provider
|
||||
}
|
||||
reliable {
|
||||
flagger
|
||||
}
|
||||
${getSlotFragmentSpreads(slots, 'user')}
|
||||
}
|
||||
totalComments: commentCount(query: {author_id: $author_id})
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* getReliability
|
||||
* retrieves reliability value as string
|
||||
*/
|
||||
|
||||
export const getReliability = (reliabilityValue) => {
|
||||
if (reliabilityValue === null) {
|
||||
return 'neutral';
|
||||
} else if (reliabilityValue) {
|
||||
return 'reliable';
|
||||
} else {
|
||||
return 'unreliable';
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user