Create generateWallet reducer and add to combined reducer.

This commit is contained in:
Daniel Ternyak 2017-04-18 18:34:24 -05:00
parent 44701f8756
commit fcc03dc6d9
2 changed files with 34 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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
})