mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
FE for the Staff Tag. Modifed typedfs graphql.
This commit is contained in:
@@ -21,6 +21,7 @@ import LikeButton from 'coral-plugin-likes/LikeButton';
|
|||||||
import styles from './Comment.css';
|
import styles from './Comment.css';
|
||||||
|
|
||||||
const getAction = (type, comment) => comment.actions.filter((a) => a.type === type)[0];
|
const getAction = (type, comment) => comment.actions.filter((a) => a.type === type)[0];
|
||||||
|
const isStaff = (tags) => !tags.every((t) => t.name !== 'STAFF') ;
|
||||||
|
|
||||||
class Comment extends React.Component {
|
class Comment extends React.Component {
|
||||||
|
|
||||||
@@ -101,7 +102,7 @@ class Comment extends React.Component {
|
|||||||
<hr aria-hidden={true} />
|
<hr aria-hidden={true} />
|
||||||
<AuthorName
|
<AuthorName
|
||||||
author={comment.user}/>
|
author={comment.user}/>
|
||||||
<TagLabel/>
|
<TagLabel isStaff={isStaff(comment.tags)}/>
|
||||||
<PubDate created_at={comment.created_at} />
|
<PubDate created_at={comment.created_at} />
|
||||||
<Content body={comment.body} />
|
<Content body={comment.body} />
|
||||||
<div className="commentActionsLeft">
|
<div className="commentActionsLeft">
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
const name = 'coral-plugin-tag-label';
|
|
||||||
|
|
||||||
const TagLabel = () => <div className={`${name }-text`}>
|
import styles from './styles.css';
|
||||||
oh yeah
|
|
||||||
|
const TagLabel = ({isStaff}) => <div className={`${styles.staff}`}>
|
||||||
|
{(isStaff) ? 'Staff' : ''}
|
||||||
</div>;
|
</div>;
|
||||||
|
|
||||||
export default TagLabel;
|
export default TagLabel;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
.tagLabel {
|
.staff {
|
||||||
color: black;
|
background-color: #4C1066;
|
||||||
|
color: white;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 10px 0;
|
margin: 10px 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ input CommentsQuery {
|
|||||||
# limit the number of results to be returned.
|
# limit the number of results to be returned.
|
||||||
limit: Int = 10
|
limit: Int = 10
|
||||||
|
|
||||||
|
# filter by a specific tag name.
|
||||||
|
tag: [String]
|
||||||
|
|
||||||
# skip results from the last created_at timestamp.
|
# skip results from the last created_at timestamp.
|
||||||
cursor: Date
|
cursor: Date
|
||||||
|
|
||||||
@@ -65,7 +68,7 @@ type User {
|
|||||||
|
|
||||||
type Tag {
|
type Tag {
|
||||||
# the actual tag for the comment.
|
# the actual tag for the comment.
|
||||||
name: COMMENT_TAG
|
name: String!
|
||||||
|
|
||||||
# the user that assigned the tag. If NULL then the system automatically tagged it.
|
# the user that assigned the tag. If NULL then the system automatically tagged it.
|
||||||
assigned_by: String
|
assigned_by: String
|
||||||
@@ -179,11 +182,6 @@ type Asset {
|
|||||||
created_at: Date
|
created_at: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
enum COMMENT_TAG {
|
|
||||||
# For the comments submitted by staff members (ADMIN or MODERATOR users).
|
|
||||||
STAFF
|
|
||||||
}
|
|
||||||
|
|
||||||
enum COMMENT_STATUS {
|
enum COMMENT_STATUS {
|
||||||
ACCEPTED
|
ACCEPTED
|
||||||
REJECTED
|
REJECTED
|
||||||
|
|||||||
Reference in New Issue
Block a user