Using same slot

This commit is contained in:
Belen Curcio
2017-07-14 13:39:35 -03:00
parent 94032b69fc
commit 71b4413f92
5 changed files with 17 additions and 5 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ import translations from './translations.yml';
export default {
translations,
slots: {
commentReactions: [LikeButton],
featuredCommentsReactions: [LikeButton]
commentReactions: [LikeButton]
}
};
@@ -6,7 +6,7 @@ import {timeago} from 'coral-framework/services/i18n';
import {Slot} from 'plugin-api/beta/client/components';
import {Icon} from 'plugin-api/beta/client/components/ui';
const FeaturedComment = ({comment, setActiveTab}) => {
const FeaturedComment = ({comment, asset, setActiveTab}) => {
return (
<div className={cn(styles.featuredComment, `${name}__featured-comment`)}>
@@ -25,10 +25,12 @@ const FeaturedComment = ({comment, setActiveTab}) => {
<footer className={cn(styles.footer, `${name}__featured-comment__footer`)}>
<div className={cn(styles.reactionsContainer, `${name}__featured-comment__reactions`)}>
<Slot
fill="featuredCommentsReactions"
fill="commentReactions"
comment={comment}
commentId={comment.id}
asset={asset}
inline
/>
</div>
@@ -1,12 +1,13 @@
import React from 'react';
import FeaturedComment from './FeaturedComment';
export default ({asset: {featuredComments}, setActiveTab}) => (
export default ({asset: {featuredComments, ...asset}, setActiveTab}) => (
<div>
{featuredComments.nodes.map((comment) =>
<FeaturedComment
key={comment.id}
comment={comment}
asset={asset}
setActiveTab={setActiveTab} />
)}
</div>
@@ -15,12 +15,18 @@ const enhance = compose(
withFragments({
asset: gql`
fragment TalkFeatured_TabPane_asset on Asset {
id
featuredComments: comments(tags: ["FEATURED"]) {
nodes {
id
body
created_at
replyCount
tags {
tag {
name
}
}
action_summaries {
... on LikeActionSummary {
count
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1