From fcc03dc6d96ed4dcf1c608a23f25e0bba8edec7f Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Tue, 18 Apr 2017 18:34:24 -0500 Subject: [PATCH] Create generateWallet reducer and add to combined reducer. --- common/reducers/generateWallet.js | 29 +++++++++++++++++++++++++++++ common/reducers/index.js | 5 +++++ 2 files changed, 34 insertions(+) create mode 100644 common/reducers/generateWallet.js diff --git a/common/reducers/generateWallet.js b/common/reducers/generateWallet.js new file mode 100644 index 00000000..c06c4aac --- /dev/null +++ b/common/reducers/generateWallet.js @@ -0,0 +1,29 @@ +import {GENERATE_WALLET_SHOW_PASSWORD, GENERATE_WALLET_FILE} from "actions/generateWallet"; + + +const initialState = { + showPassword: false, + generateWalletFile: false, + generateWalletFileConfirm: false +} + +export function generateWallet(state = initialState, action) { + switch (action.type) { + case GENERATE_WALLET_SHOW_PASSWORD: { + return { + ...state, + showPassword: !state.showPassword + } + } + + case GENERATE_WALLET_FILE: { + return { + ...state, + generateWalletFile: true + } + } + + default: + return state + } +} diff --git a/common/reducers/index.js b/common/reducers/index.js index 6284e055..ea36a696 100644 --- a/common/reducers/index.js +++ b/common/reducers/index.js @@ -3,8 +3,11 @@ import * as inbox from './inbox' import * as auth from './auth' import * as loginCR from './loginCR' import * as dashboard from './dashboard' +import * as generateWallet from './generateWallet' import * as config from './config' +import { reducer as formReducer } from 'redux-form' + import {combineReducers} from 'redux'; import {routerReducer} from 'react-router-redux' @@ -14,6 +17,8 @@ export default combineReducers({ ...auth, ...dashboard, ...loginCR, + ...generateWallet, ...config, + form: formReducer, routing: routerReducer })