From 84a20042f208ea336439215f03d33ffb9bff1958 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Tue, 25 Jul 2017 22:53:26 +0700 Subject: [PATCH] Prefix redux constants in plugins --- plugins/coral-plugin-viewing-options/client/actions.js | 6 +++--- plugins/coral-plugin-viewing-options/client/constants.js | 7 +++++-- plugins/coral-plugin-viewing-options/client/reducer.js | 8 ++++---- plugins/talk-plugin-featured-comments/client/constants.js | 6 ++++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/plugins/coral-plugin-viewing-options/client/actions.js b/plugins/coral-plugin-viewing-options/client/actions.js index 8a6473e3c..48ea73bdd 100644 --- a/plugins/coral-plugin-viewing-options/client/actions.js +++ b/plugins/coral-plugin-viewing-options/client/actions.js @@ -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, }); diff --git a/plugins/coral-plugin-viewing-options/client/constants.js b/plugins/coral-plugin-viewing-options/client/constants.js index 586fe7a28..857a76e1b 100644 --- a/plugins/coral-plugin-viewing-options/client/constants.js +++ b/plugins/coral-plugin-viewing-options/client/constants.js @@ -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`; + diff --git a/plugins/coral-plugin-viewing-options/client/reducer.js b/plugins/coral-plugin-viewing-options/client/reducer.js index ab9f077df..687de803a 100644 --- a/plugins/coral-plugin-viewing-options/client/reducer.js +++ b/plugins/coral-plugin-viewing-options/client/reducer.js @@ -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 diff --git a/plugins/talk-plugin-featured-comments/client/constants.js b/plugins/talk-plugin-featured-comments/client/constants.js index 7aad99014..c03bf4839 100644 --- a/plugins/talk-plugin-featured-comments/client/constants.js +++ b/plugins/talk-plugin-featured-comments/client/constants.js @@ -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`;