using the plugins service

This commit is contained in:
okbel
2018-03-20 13:19:20 -03:00
parent 74d065ea84
commit b6ba59ac51
3 changed files with 8 additions and 10 deletions
@@ -465,9 +465,6 @@ const mapStateToProps = state => ({
activeStreamTab: state.stream.activeTab,
previousStreamTab: state.stream.previousTab,
commentClassNames: state.stream.commentClassNames,
// @Deprecated plugin_config
pluginsConfig: state.config.plugins_config || state.config.plugin_config,
sortOrder: state.stream.sortOrder,
sortBy: state.stream.sortBy,
});
@@ -93,12 +93,6 @@ class Slot extends React.Component {
children = children.map(childFactory);
}
const debugProps = pluginsConfig.debug
? {
'data-slot-name': fill,
}
: {};
return (
<Component
className={cn(
@@ -109,7 +103,6 @@ class Slot extends React.Component {
className,
`talk-slot-${kebabCase(fill)}`
)}
{...debugProps}
>
{children}
</Component>
@@ -102,8 +102,16 @@ class PluginsService {
get(reduxState, 'config.plugins_config') ||
get(reduxState, 'config.plugin_config') ||
emptyConfig;
const debugProps = pluginsConfig.debug
? {
'data-slot-name': props.fill,
}
: {};
return {
...props,
...debugProps,
config: pluginsConfig,
...(component.fragments
? pick(queryData, Object.keys(component.fragments))