mirror of
https://github.com/wassname/talk.git
synced 2026-07-16 11:22:16 +08:00
Adding camelcase for plugin reducers 🎉 <3
This commit is contained in:
@@ -8,6 +8,7 @@ import flattenDeep from 'lodash/flattenDeep';
|
||||
import {getDefinitionName, mergeDocuments} from 'coral-framework/utils';
|
||||
import {loadTranslations} from 'coral-framework/services/i18n';
|
||||
import {injectReducers} from 'coral-framework/services/store';
|
||||
import camelize from './camelize';
|
||||
|
||||
/**
|
||||
* Returns React Elements for given slot.
|
||||
@@ -98,7 +99,7 @@ export function injectPluginsReducers() {
|
||||
const reducers = merge(
|
||||
...plugins
|
||||
.filter((o) => o.module.reducer)
|
||||
.map((o) => ({[o.plugin] : o.module.reducer}))
|
||||
.map((o) => ({[camelize(o.plugin)] : o.module.reducer}))
|
||||
);
|
||||
injectReducers(reducers);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
removeCommentClassName
|
||||
} from 'plugin-api/alpha/client/actions';
|
||||
|
||||
const mapStateToProps = ({comment, ['coral-plugin-offtopic']: offTopic}) => ({
|
||||
const mapStateToProps = ({comment, coralPluginOfftopic: offTopic}) => ({
|
||||
commentClassNames: comment.commentClassNames,
|
||||
checked: offTopic.checked
|
||||
});
|
||||
|
||||
@@ -3,7 +3,9 @@ import {bindActionCreators} from 'redux';
|
||||
import ViewingOptions from '../components/ViewingOptions';
|
||||
import {openViewingOptions, closeViewingOptions} from '../actions';
|
||||
|
||||
const mapStateToProps = ({['coral-plugin-viewing-options']: state}) => ({open: state.open});
|
||||
const mapStateToProps = ({coralPluginViewingOptions: state}) => ({
|
||||
open: state.open
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators({openViewingOptions, closeViewingOptions}, dispatch);
|
||||
|
||||
Reference in New Issue
Block a user