mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Tag.name as string. Debuging comment.tag in Embed stream.
This commit is contained in:
@@ -10,6 +10,7 @@ import React, {PropTypes} from 'react';
|
||||
import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton';
|
||||
|
||||
import AuthorName from 'coral-plugin-author-name/AuthorName';
|
||||
|
||||
import TagLabel from 'coral-plugin-tag-label/TagLabel';
|
||||
import Content from 'coral-plugin-commentcontent/CommentContent';
|
||||
import PubDate from 'coral-plugin-pubdate/PubDate';
|
||||
@@ -55,6 +56,11 @@ class Comment extends React.Component {
|
||||
actions: PropTypes.array.isRequired,
|
||||
body: PropTypes.string.isRequired,
|
||||
id: PropTypes.string.isRequired,
|
||||
tags: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
name: PropTypes.string
|
||||
})
|
||||
),
|
||||
replies: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
body: PropTypes.string.isRequired,
|
||||
@@ -95,8 +101,7 @@ class Comment extends React.Component {
|
||||
<hr aria-hidden={true} />
|
||||
<AuthorName
|
||||
author={comment.user}/>
|
||||
<TagLabel
|
||||
tags={comment.tags}/>
|
||||
<TagLabel/>
|
||||
<PubDate created_at={comment.created_at} />
|
||||
<Content body={comment.body} />
|
||||
<div className="commentActionsLeft">
|
||||
|
||||
@@ -13,7 +13,7 @@ function getQueryVariable(variable) {
|
||||
}
|
||||
|
||||
// If no query is included, return a default string for development
|
||||
return 'http://dev.default.stream';
|
||||
return 'http://localhost:3030';
|
||||
}
|
||||
|
||||
export const queryStream = graphql(STREAM_QUERY, {
|
||||
|
||||
@@ -58,6 +58,9 @@ const StreamQuery = gql`fragment commentView on Comment {
|
||||
user {
|
||||
name: displayName
|
||||
}
|
||||
tags {
|
||||
name
|
||||
}
|
||||
actions {
|
||||
type: action_type
|
||||
count
|
||||
|
||||
@@ -1,18 +1,8 @@
|
||||
import React, {Component} from 'react';
|
||||
const packagename = 'coral-plugin-tag-label';
|
||||
import styles from './styles.css';
|
||||
import React from 'react';
|
||||
const name = 'coral-plugin-tag-label';
|
||||
|
||||
export default class TagLabel extends Component {
|
||||
const TagLabel = () => <div className={`${name }-text`}>
|
||||
oh yeah
|
||||
</div>;
|
||||
|
||||
render () {
|
||||
const {tags} = this.props;
|
||||
console.log('DEBUG ', tags);
|
||||
return (
|
||||
<div
|
||||
className={`${packagename}-text`}
|
||||
className={`${styles.tagLabel}`}>
|
||||
{tags}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
export default TagLabel;
|
||||
|
||||
+1
-9
@@ -9,11 +9,6 @@ const STATUSES = [
|
||||
null
|
||||
];
|
||||
|
||||
const TAGS = [
|
||||
'STAFF',
|
||||
null
|
||||
];
|
||||
|
||||
/**
|
||||
* The Mongo schema for a Comment Status.
|
||||
* @type {Schema}
|
||||
@@ -40,10 +35,7 @@ const StatusSchema = new Schema({
|
||||
* @type {Schema}
|
||||
*/
|
||||
const TagSchema = new Schema({
|
||||
name: {
|
||||
type: String,
|
||||
enum: TAGS,
|
||||
},
|
||||
name: String,
|
||||
|
||||
// The User ID of the user that assigned the status.
|
||||
assigned_by: {
|
||||
|
||||
Reference in New Issue
Block a user