Viewing Options state and name conventions

This commit is contained in:
Belen Curcio
2017-06-07 09:53:53 -03:00
parent e24f6ca9f1
commit 4725f07757
10 changed files with 44 additions and 36 deletions
@@ -38,11 +38,3 @@ export const viewAllComments = () => {
return {type: actions.VIEW_ALL_COMMENTS};
};
export const openViewingOptions = () => ({
type: actions.OPEN_VIEWING_OPTIONS
});
export const closeViewingOptions = () => ({
type: actions.CLOSE_VIEWING_OPTIONS
});
@@ -3,5 +3,3 @@ export const SET_COMMENT_COUNT_CACHE = 'SET_COMMENT_COUNT_CACHE';
export const ADDTL_COMMENTS_ON_LOAD_MORE = 10;
export const NEW_COMMENT_COUNT_POLL_INTERVAL = 20000;
export const VIEW_ALL_COMMENTS = 'VIEW_ALL_COMMENTS';
export const OPEN_VIEWING_OPTIONS = 'OPEN_VIEWING_OPTIONS';
export const CLOSE_VIEWING_OPTIONS = 'CLOSE_VIEWING_OPTIONS';
@@ -20,27 +20,10 @@ const initialState = {
assetId: getQueryVariable('asset_id'),
assetUrl: getQueryVariable('asset_url'),
commentId: getQueryVariable('comment_id'),
viewingOption: {
open: false
}
};
export default function stream(state = initialState, action) {
switch (action.type) {
case actions.OPEN_VIEWING_OPTIONS:
return {
...state,
viewingOption: {
open: true
}
};
case actions.CLOSE_VIEWING_OPTIONS:
return {
...state,
viewingOption: {
open: false
}
};
case actions.SET_ACTIVE_REPLY_BOX:
return {
...state,
+5 -5
View File
@@ -1,17 +1,17 @@
import React from 'react';
import merge from 'lodash/merge';
import flatten from 'lodash/flatten';
import flattenDeep from 'lodash/flattenDeep';
import uniq from 'lodash/uniq';
import pick from 'lodash/pick';
import merge from 'lodash/merge';
import plugins from 'pluginsConfig';
import {getDefinitionName, mergeDocuments} from 'coral-framework/utils';
import flatten from 'lodash/flatten';
import flattenDeep from 'lodash/flattenDeep';
import {loadTranslations} from 'coral-framework/services/i18n';
import {getDefinitionName, mergeDocuments} from 'coral-framework/utils';
export const pluginReducers = merge(
...plugins
.filter((o) => o.module.reducer)
.map((o) => ({[o.module.reducer.name] : o.module.reducer}))
.map((o) => ({[o.plugin] : o.module.reducer}))
);
/**