postRespect

This commit is contained in:
Belen Curcio
2017-03-30 19:17:22 -03:00
parent b7e00f1da4
commit cd08987502
5 changed files with 24 additions and 9 deletions
-2
View File
@@ -148,8 +148,6 @@ class Comment extends React.Component {
...rest
};
console.log('Commnet --------', pluginProps)
return (
<div
className={commentClass}
+2 -2
View File
@@ -135,7 +135,7 @@ class Embed extends Component {
return (
<div style={expandForLogin}>
<div className="commentStream">
{/*<Slot fill="Stream" pluginProps={pluginProps} />*/}
{/* <Slot fill="Stream" pluginProps={pluginProps} />*/}
<TabBar onChange={this.changeTab} activeTab={activeTab}>
<Tab><Count count={asset.totalCommentCount}/></Tab>
<Tab>{lang.t('MY_COMMENTS')}</Tab>
@@ -282,7 +282,7 @@ const mapStateToProps = (state) => Object
userData: state.user.toJS(),
asset: state.asset.toJS(),
state: {}
});
});
const mapDispatchToProps = dispatch => ({
requestConfirmEmail: () => dispatch(requestConfirmEmail()),
@@ -67,6 +67,10 @@ function injectPlugins ({fill, ...props}) {
.map(addProps)
.filter(filterBySlot)
.reduce((entry, plugin, i) => {
// const element = React.cloneElement(
// context(plugin.key),
// {...plugin.props, key: i}
// );
entry = [...entry, context(plugin.key)({...plugin.props, key: i})];
return entry;
}, []);
+6 -5
View File
@@ -4,11 +4,12 @@ import {Icon} from 'coral-ui';
export default (props) => {
const handleClick = () => {
props.actions.clickButton();
// props.postRespect({
// item_id: props.comment.id,
// item_type: 'COMMENTS'
// });
// props.actions.clic kButton();
props.context.postRespect({
item_id: props.context.comment.id,
item_type: 'COMMENTS'
});
};
const {clicked} = props.state.respect;
+12
View File
@@ -8,5 +8,17 @@ module.exports = {
return Action.create({item_id, item_type, action_type: 'RESPECT'});
}
}
},
hooks: {
ActionSummary: {
__resolveType: {
post({action_type}) {
switch (action_type) {
case 'RESPECT':
return 'HappyActionSummary';
}
}
}
}
}
};