mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 07:42:02 +08:00
Working respect count
This commit is contained in:
@@ -18,7 +18,7 @@ import {queryStream} from 'coral-framework/graphql/queries';
|
||||
import {postComment, postFlag, postLike, postDontAgree, deleteAction, addCommentTag, removeCommentTag} from 'coral-framework/graphql/mutations';
|
||||
import {editName} from 'coral-framework/actions/user';
|
||||
import {updateCountCache} from 'coral-framework/actions/asset';
|
||||
import {notificationActions, authActions, assetActions, pym, Slot, actions} from 'coral-framework';
|
||||
import {notificationActions, authActions, assetActions, pym, actions} from 'coral-framework';
|
||||
|
||||
import Stream from './Stream';
|
||||
import InfoBox from 'coral-plugin-infobox/InfoBox';
|
||||
@@ -135,7 +135,6 @@ class Embed extends Component {
|
||||
return (
|
||||
<div style={expandForLogin}>
|
||||
<div className="commentStream">
|
||||
{/* <Slot fill="Stream" pluginProps={pluginProps} />*/}
|
||||
<TabBar onChange={this.changeTab} activeTab={activeTab}>
|
||||
<Tab><Count count={asset.totalCommentCount}/></Tab>
|
||||
<Tab>{lang.t('MY_COMMENTS')}</Tab>
|
||||
|
||||
@@ -2,25 +2,28 @@ import React from 'react';
|
||||
import styles from './style.css';
|
||||
import {Icon} from 'coral-ui';
|
||||
|
||||
export default (props) => {
|
||||
const handleClick = () => {
|
||||
// props.actions.clic kButton();
|
||||
const getActionSummary = (type, comment) => comment.action_summaries
|
||||
.filter((a) => a.__typename === type)[0];
|
||||
|
||||
export default (props) => {
|
||||
const {comment} = props.context;
|
||||
|
||||
const handleClick = () => {
|
||||
props.context.postRespect({
|
||||
item_id: props.context.comment.id,
|
||||
item_id: comment.id,
|
||||
item_type: 'COMMENTS'
|
||||
});
|
||||
};
|
||||
const {clicked} = props.state.respect;
|
||||
|
||||
const respectActionSummary = getActionSummary('RespectActionSummary', comment);
|
||||
|
||||
return (
|
||||
<div className={styles.Respect} key={props.key}>
|
||||
<button
|
||||
className={clicked ? styles.clicked : ''}
|
||||
onClick={handleClick}>
|
||||
Respect
|
||||
<Icon name="done"/>
|
||||
<span>9</span>
|
||||
{respectActionSummary ? <span>{respectActionSummary.count}</span> : null}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user