mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Prefix redux constants in plugins
This commit is contained in:
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user