Slots and off topic plugin

This commit is contained in:
Belen Curcio
2017-04-07 14:12:51 -03:00
parent c6189e8b3a
commit aef0f433c9
4 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ class Comment extends React.Component {
? <TagLabel><BestIndicator /></TagLabel>
: null }
<PubDate created_at={comment.created_at} />
<Slot fill="commentInfoBar" commentId={comment.id} />
<Slot fill="commentInfoBar" commentId={comment.id} inline/>
<Content body={comment.body} />
<div className="commentActionsLeft comment__action-container">
+3 -2
View File
@@ -1,11 +1,12 @@
import React, {Component} from 'react';
import {getSlotElements} from 'coral-framework/helpers/plugins';
import styles from './Slot.css';
class Slot extends Component {
render() {
const {fill, ...rest} = this.props;
const {fill, inline = false, ...rest} = this.props;
return (
<div>
<div className={inline ? styles.inline : ''}>
{getSlotElements(fill, rest)}
</div>
);
@@ -2,6 +2,8 @@ import React, {Component, PropTypes} from 'react';
import {I18n} from '../coral-framework';
import translations from './translations.json';
import {Button} from 'coral-ui';
import {Slot} from 'coral-framework';
import styles from './styles.css';
const name = 'coral-plugin-commentbox';
@@ -102,6 +104,7 @@ class CommentBox extends Component {
`${charCount - length} ${lang.t('characters-remaining')}`
}
</div>
<Slot fill="commentBoxDetail" inline/>
<div className={`${name}-button-container`}>
{
isReply && (
@@ -1,4 +1,5 @@
import RespectButton from './containers/RespectButton';
export default {
slots: {
commentDetail: [RespectButton],