diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-11-10 03:15:32 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-11-10 03:15:32 +0800 |
commit | daa011f7cbbc6719d99eef251d07f552e23c21fb (patch) | |
tree | da1af3c83e7ed8677228714a18d67ea97147119a /packages/instant/src/redux/reducer.ts | |
parent | 239eada7d92e27ab5aa81d3364ffe5d83d0680a7 (diff) | |
download | dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.gz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.bz2 dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.lz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.xz dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.tar.zst dexon-sol-tools-daa011f7cbbc6719d99eef251d07f552e23c21fb.zip |
feat: implement CurrentStandardSlidingPanel and put it in the main container
Diffstat (limited to 'packages/instant/src/redux/reducer.ts')
-rw-r--r-- | packages/instant/src/redux/reducer.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/instant/src/redux/reducer.ts b/packages/instant/src/redux/reducer.ts index a5a1b6f7d..a542979cb 100644 --- a/packages/instant/src/redux/reducer.ts +++ b/packages/instant/src/redux/reducer.ts @@ -19,6 +19,8 @@ import { OrderProcessState, OrderState, ProviderState, + StandardSlidingPanelContent, + StandardSlidingPanelSettings, } from '../types'; import { Action, ActionTypes } from './actions'; @@ -30,6 +32,7 @@ export interface DefaultState { buyOrderState: OrderState; latestErrorDisplayStatus: DisplayStatus; quoteRequestState: AsyncProcessState; + standardSlidingPanelSettings: StandardSlidingPanelSettings; } // State that is required but needs to be derived from the props @@ -56,6 +59,10 @@ export const DEFAULT_STATE: DefaultState = { buyOrderState: { processState: OrderProcessState.None }, latestErrorDisplayStatus: DisplayStatus.Hidden, quoteRequestState: AsyncProcessState.None, + standardSlidingPanelSettings: { + animationState: 'none', + content: StandardSlidingPanelContent.None, + }, }; export const createReducer = (initialState: State) => { @@ -213,6 +220,22 @@ export const createReducer = (initialState: State) => { ...state, availableAssets: action.data, }; + case ActionTypes.OPEN_STANDARD_SLIDING_PANEL: + return { + ...state, + standardSlidingPanelSettings: { + content: action.data, + animationState: 'slidIn', + }, + }; + case ActionTypes.CLOSE_STANDARD_SLIDING_PANEL: + return { + ...state, + standardSlidingPanelSettings: { + content: state.standardSlidingPanelSettings.content, + animationState: 'slidOut', + }, + }; default: return state; } |