mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 14:41:09 +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';
|
||||
|
||||
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 {
|
||||
|
||||
@@ -101,7 +102,7 @@ class Comment extends React.Component {
|
||||
<hr aria-hidden={true} />
|
||||
<AuthorName
|
||||
author={comment.user}/>
|
||||
<TagLabel/>
|
||||
<TagLabel isStaff={isStaff(comment.tags)}/>
|
||||
<PubDate created_at={comment.created_at} />
|
||||
<Content body={comment.body} />
|
||||
<div className="commentActionsLeft">
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import React from 'react';
|
||||
const name = 'coral-plugin-tag-label';
|
||||
|
||||
const TagLabel = () => <div className={`${name }-text`}>
|
||||
oh yeah
|
||||
import styles from './styles.css';
|
||||
|
||||
const TagLabel = ({isStaff}) => <div className={`${styles.staff}`}>
|
||||
{(isStaff) ? 'Staff' : ''}
|
||||
</div>;
|
||||
|
||||
export default TagLabel;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.tagLabel {
|
||||
color: black;
|
||||
.staff {
|
||||
background-color: #4C1066;
|
||||
color: white;
|
||||
display: inline-block;
|
||||
margin: 10px 0;
|
||||
margin: 10px 10px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user