You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/reducers/SummaryReducer.js

39 lines
869 B

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