Prefix redux constants in plugins

This commit is contained in:
Chi Vinh Le
2017-07-25 22:53:26 +07:00
parent fefbec032c
commit 84a20042f2
4 changed files with 16 additions and 11 deletions
@@ -1,9 +1,9 @@
import {VIEWING_OPTIONS_OPEN, VIEWING_OPTIONS_CLOSE} from './constants';
import {OPEN_MENU, CLOSE_MENU} from './constants';
export const openViewingOptions = () => ({
type: VIEWING_OPTIONS_OPEN
type: OPEN_MENU,
});
export const closeViewingOptions = () => ({
type: VIEWING_OPTIONS_CLOSE
type: CLOSE_MENU,
});
@@ -1,2 +1,5 @@
export const VIEWING_OPTIONS_OPEN = 'VIEWING_OPTIONS_OPEN';
export const VIEWING_OPTIONS_CLOSE = 'VIEWING_OPTIONS_CLOSE';
const prefix = 'TALK_VIEWING_OPTIONS';
export const OPEN_MENU = `${prefix}_OPEN_MENU`;
export const CLOSE_MENU = `${prefix}_CLOSE_MENU`;
@@ -1,17 +1,17 @@
import {VIEWING_OPTIONS_OPEN, VIEWING_OPTIONS_CLOSE} from './constants';
import {OPEN_MENU, CLOSE_MENU} from './constants';
const initialState = {
open: false
};
export default function offTopic (state = initialState, action) {
export default function reducer(state = initialState, action) {
switch (action.type) {
case VIEWING_OPTIONS_OPEN:
case OPEN_MENU:
return {
...state,
open: true
};
case VIEWING_OPTIONS_CLOSE:
case CLOSE_MENU:
return {
...state,
open: false
@@ -1,2 +1,4 @@
export const SHOW_TOOLTIP = 'SHOW_TOOLTIP';
export const HIDE_TOOLTIP = 'HIDE_TOOLTIP';
const prefix = 'TALK_FEATURED_COMMENTS';
export const SHOW_TOOLTIP = `${prefix}_SHOW_TOOLTIP`;
export const HIDE_TOOLTIP = `${prefix}_HIDE_TOOLTIP`;