mirror of
https://github.com/wassname/talk.git
synced 2026-07-18 12:40:13 +08:00
Merge pull request #839 from coralproject/fix-bug-plugin-config
Pass config to plugins
This commit is contained in:
@@ -10,7 +10,7 @@ import camelize from './camelize';
|
||||
import plugins from 'pluginsConfig';
|
||||
|
||||
export function getSlotComponents(slot, reduxState, props = {}) {
|
||||
const pluginConfig = reduxState.config.pluginConfig || {};
|
||||
const pluginConfig = reduxState.config.plugin_config || {};
|
||||
return flatten(plugins
|
||||
|
||||
// Filter out components that have slots and have been disabled in `plugin_config`
|
||||
@@ -39,7 +39,7 @@ export function isSlotEmpty(slot, reduxState, props) {
|
||||
* Returns React Elements for given slot.
|
||||
*/
|
||||
export function getSlotElements(slot, reduxState, props = {}) {
|
||||
const pluginConfig = reduxState.config.pluginConfig || {};
|
||||
const pluginConfig = reduxState.config.plugin_config || {};
|
||||
return getSlotComponents(slot, reduxState, props)
|
||||
.map((component, i) => React.createElement(component, {key: i, ...props, config: pluginConfig}));
|
||||
}
|
||||
|
||||
@@ -271,6 +271,7 @@ export default (reaction) => (WrappedComponent) => {
|
||||
alreadyReacted={alreadyReacted}
|
||||
postReaction={this.postReaction}
|
||||
deleteReaction={this.deleteReaction}
|
||||
config={this.props.config}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,16 +68,17 @@ export default (tag) => (WrappedComponent) => {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {comment} = this.props;
|
||||
const {comment, user, config} = this.props;
|
||||
|
||||
const alreadyTagged = isTagged(comment.tags, TAG);
|
||||
|
||||
return <WrappedComponent
|
||||
user={this.props.user}
|
||||
user={user}
|
||||
comment={comment}
|
||||
alreadyTagged={alreadyTagged}
|
||||
postTag={this.postTag}
|
||||
deleteTag={this.deleteTag}
|
||||
config={config}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user