mirror of
https://github.com/wassname/talk.git
synced 2026-07-17 11:33:39 +08:00
Removing LIKE from talk
This commit is contained in:
@@ -20,7 +20,6 @@ const fm = new IntrospectionFragmentMatcher({
|
||||
name: 'Response',
|
||||
possibleTypes: [
|
||||
{name: 'CreateCommentResponse'},
|
||||
{name: 'CreateLikeResponse'},
|
||||
{name: 'CreateFlagResponse'},
|
||||
{name: 'CreateDontAgreeResponse'},
|
||||
{name: 'DeleteActionResponse'},
|
||||
@@ -38,7 +37,6 @@ const fm = new IntrospectionFragmentMatcher({
|
||||
name: 'Action',
|
||||
possibleTypes: [
|
||||
{name: 'FlagAction'},
|
||||
{name: 'LikeAction'},
|
||||
{name: 'DontAgreeAction'}
|
||||
],
|
||||
},
|
||||
@@ -47,7 +45,6 @@ const fm = new IntrospectionFragmentMatcher({
|
||||
name: 'ActionSummary',
|
||||
possibleTypes: [
|
||||
{name: 'FlagActionSummary'},
|
||||
{name: 'LikeActionSummary'},
|
||||
{name: 'DontAgreeActionSummary'}
|
||||
],
|
||||
},
|
||||
@@ -57,7 +54,6 @@ const fm = new IntrospectionFragmentMatcher({
|
||||
possibleTypes: [
|
||||
{name: 'DefaultAssetActionSummary'},
|
||||
{name: 'FlagAssetActionSummary'},
|
||||
{name: 'LikeAssetActionSummary'}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
// this component will
|
||||
// render its children
|
||||
// render a like button
|
||||
// render a permalink button
|
||||
// render a reply button
|
||||
// render a flag button
|
||||
// translate things?
|
||||
|
||||
import React, {PropTypes} from 'react';
|
||||
import PermalinkButton from 'coral-plugin-permalinks/PermalinkButton';
|
||||
|
||||
@@ -16,7 +8,6 @@ import Content from 'coral-plugin-commentcontent/CommentContent';
|
||||
import PubDate from 'coral-plugin-pubdate/PubDate';
|
||||
import {ReplyBox, ReplyButton} from 'coral-plugin-replies';
|
||||
import FlagComment from 'coral-plugin-flags/FlagComment';
|
||||
import LikeButton from 'coral-plugin-likes/LikeButton';
|
||||
import {BestButton, IfUserCanModifyBest, BEST_TAG, commentIsBest, BestIndicator} from 'coral-plugin-best/BestButton';
|
||||
import Slot from 'coral-framework/components/Slot';
|
||||
import LoadMore from './LoadMore';
|
||||
@@ -28,7 +19,7 @@ import styles from './Comment.css';
|
||||
|
||||
const isStaff = (tags) => !tags.every((t) => t.name !== 'STAFF') ;
|
||||
|
||||
// hold actions links (e.g. Like, Reply) along the comment footer
|
||||
// hold actions links (e.g. Reply) along the comment footer
|
||||
const ActionButton = ({children}) => {
|
||||
return <span className="comment__action-button comment__action-button--nowrap">{ children }</span>;
|
||||
};
|
||||
@@ -49,7 +40,6 @@ class Comment extends React.Component {
|
||||
setActiveReplyBox: PropTypes.func.isRequired,
|
||||
showSignInDialog: PropTypes.func.isRequired,
|
||||
postFlag: PropTypes.func.isRequired,
|
||||
postLike: PropTypes.func.isRequired,
|
||||
deleteAction: PropTypes.func.isRequired,
|
||||
parentId: PropTypes.string,
|
||||
highlighted: PropTypes.string,
|
||||
@@ -110,7 +100,6 @@ class Comment extends React.Component {
|
||||
postItem,
|
||||
addNotification,
|
||||
showSignInDialog,
|
||||
postLike,
|
||||
highlighted,
|
||||
postFlag,
|
||||
postDontAgree,
|
||||
@@ -127,7 +116,6 @@ class Comment extends React.Component {
|
||||
charCountEnable,
|
||||
} = this.props;
|
||||
|
||||
const likeSummary = getActionSummary('LikeActionSummary', comment);
|
||||
const flagSummary = getActionSummary('FlagActionSummary', comment);
|
||||
const dontAgreeSummary = getActionSummary('DontAgreeActionSummary', comment);
|
||||
let myFlag = null;
|
||||
@@ -198,17 +186,6 @@ class Comment extends React.Component {
|
||||
|
||||
<Content body={comment.body} />
|
||||
<div className="commentActionsLeft comment__action-container">
|
||||
<ActionButton>
|
||||
{/* TODO implmement iPerformedThisAction for the like */}
|
||||
<LikeButton
|
||||
totalLikes={getTotalActionCount('LikeActionSummary', comment)}
|
||||
like={likeSummary[0]}
|
||||
id={comment.id}
|
||||
postLike={postLike}
|
||||
deleteAction={deleteAction}
|
||||
showSignInDialog={showSignInDialog}
|
||||
currentUser={currentUser} />
|
||||
</ActionButton>
|
||||
{
|
||||
!disableReply &&
|
||||
<ActionButton>
|
||||
@@ -288,7 +265,6 @@ class Comment extends React.Component {
|
||||
asset={asset}
|
||||
highlighted={highlighted}
|
||||
currentUser={currentUser}
|
||||
postLike={postLike}
|
||||
postFlag={postFlag}
|
||||
deleteAction={deleteAction}
|
||||
addCommentTag={addCommentTag}
|
||||
|
||||
@@ -28,7 +28,6 @@ class Stream extends React.Component {
|
||||
postItem,
|
||||
addNotification,
|
||||
postFlag,
|
||||
postLike,
|
||||
postDontAgree,
|
||||
loadMore,
|
||||
deleteAction,
|
||||
@@ -117,7 +116,6 @@ class Stream extends React.Component {
|
||||
asset={asset}
|
||||
currentUser={user}
|
||||
highlighted={comment.id}
|
||||
postLike={this.props.postLike}
|
||||
postFlag={this.props.postFlag}
|
||||
postDontAgree={this.props.postDontAgree}
|
||||
loadMore={this.props.loadMore}
|
||||
@@ -157,7 +155,6 @@ class Stream extends React.Component {
|
||||
postItem={postItem}
|
||||
asset={asset}
|
||||
currentUser={user}
|
||||
postLike={postLike}
|
||||
postFlag={postFlag}
|
||||
postDontAgree={postDontAgree}
|
||||
addCommentTag={addCommentTag}
|
||||
|
||||
@@ -6,7 +6,7 @@ import uniqBy from 'lodash/uniqBy';
|
||||
import sortBy from 'lodash/sortBy';
|
||||
import isNil from 'lodash/isNil';
|
||||
import {NEW_COMMENT_COUNT_POLL_INTERVAL} from '../constants/stream';
|
||||
import {postComment, postFlag, postLike, postDontAgree, deleteAction, addCommentTag, removeCommentTag, ignoreUser} from 'coral-framework/graphql/mutations';
|
||||
import {postComment, postFlag, postDontAgree, deleteAction, addCommentTag, removeCommentTag, ignoreUser} from 'coral-framework/graphql/mutations';
|
||||
import {notificationActions, authActions} from 'coral-framework';
|
||||
import {editName} from 'coral-framework/actions/user';
|
||||
import {setCommentCountCache, setActiveReplyBox} from '../actions/stream';
|
||||
@@ -217,7 +217,6 @@ const mapStateToProps = state => ({
|
||||
auth: state.auth.toJS(),
|
||||
commentCountCache: state.stream.commentCountCache,
|
||||
activeReplyBox: state.stream.activeReplyBox,
|
||||
|
||||
commentId: state.stream.commentId,
|
||||
assetId: state.stream.assetId,
|
||||
assetUrl: state.stream.assetUrl,
|
||||
@@ -239,7 +238,6 @@ export default compose(
|
||||
connect(mapStateToProps, mapDispatchToProps),
|
||||
postComment,
|
||||
postFlag,
|
||||
postLike,
|
||||
postDontAgree,
|
||||
addCommentTag,
|
||||
removeCommentTag,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {graphql} from 'react-apollo';
|
||||
import POST_COMMENT from './postComment.graphql';
|
||||
import POST_FLAG from './postFlag.graphql';
|
||||
import POST_LIKE from './postLike.graphql';
|
||||
import POST_DONT_AGREE from './postDontAgree.graphql';
|
||||
import DELETE_ACTION from './deleteAction.graphql';
|
||||
import ADD_COMMENT_TAG from './addCommentTag.graphql';
|
||||
@@ -83,17 +82,6 @@ export const postComment = graphql(POST_COMMENT, {
|
||||
}),
|
||||
});
|
||||
|
||||
export const postLike = graphql(POST_LIKE, {
|
||||
props: ({mutate}) => ({
|
||||
postLike: (like) => {
|
||||
return mutate({
|
||||
variables: {
|
||||
like
|
||||
}
|
||||
});
|
||||
}}),
|
||||
});
|
||||
|
||||
export const postFlag = graphql(POST_FLAG, {
|
||||
props: ({mutate}) => ({
|
||||
postFlag: (flag) => {
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
mutation CreateLike ($like: CreateLikeInput!) {
|
||||
createLike(like:$like) {
|
||||
like {
|
||||
id
|
||||
}
|
||||
errors {
|
||||
translation_key
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user