1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-06 14:52:33 +00:00
trezor-wallet/src/js/reducers/SummaryReducer.js
2018-04-11 15:21:43 +02:00

37 lines
658 B
JavaScript

/* @flow */
'use strict';
import * as SUMMARY from '../actions/constants/summary';
export type State = {
details: boolean;
selectedToken: any;
}
export const initialState: State = {
details: true,
selectedToken: null
};
export default (state: State = initialState, action: any): State => {
switch (action.type) {
case SUMMARY.INIT :
return action.state;
case SUMMARY.DISPOSE :
return initialState;
case SUMMARY.DETAILS_TOGGLE :
return {
...state,
details: !state.details
}
default:
return state;
}
}