From d7a5e613fad3b5cfaba883018225b151ee8a2096 Mon Sep 17 00:00:00 2001 From: okbel Date: Mon, 18 Dec 2017 12:19:46 -0300 Subject: [PATCH] Adding reducer --- .../client/reducer.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 plugins/talk-plugin-featured-comments/client/reducer.js diff --git a/plugins/talk-plugin-featured-comments/client/reducer.js b/plugins/talk-plugin-featured-comments/client/reducer.js new file mode 100644 index 000000000..3840155b3 --- /dev/null +++ b/plugins/talk-plugin-featured-comments/client/reducer.js @@ -0,0 +1,22 @@ +import {OPEN_FEATURED_DIALOG, CLOSE_FEATURED_DIALOG} from './constants'; + +const initialState = { + showFeaturedDialog: false, +}; + +export default function reducer(state = initialState, action) { + switch (action.type) { + case OPEN_FEATURED_DIALOG: + return { + ...state, + showFeaturedDialog: true, + }; + case CLOSE_FEATURED_DIALOG: + return { + ...state, + showFeaturedDialog: false, + }; + default : + return state; + } +}