mirror of
https://github.com/wassname/talk.git
synced 2026-07-05 11:09:40 +08:00
Slots and off topic plugin
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user