diff --git a/common/actions/swap.js b/common/actions/swap.js index 15f2a4d0..cdb3b1e1 100644 --- a/common/actions/swap.js +++ b/common/actions/swap.js @@ -3,7 +3,8 @@ import { SWAP_DESTINATION_KIND, SWAP_ORIGIN_AMOUNT, SWAP_ORIGIN_KIND, - SWAP_UPDATE_BITY_RATES + SWAP_UPDATE_BITY_RATES, + SWAP_PART_ONE_COMPLETE } from './swapConstants'; export const originKindSwap = value => { @@ -40,3 +41,10 @@ export const updateBityRatesSwap = value => { value }; }; + +export const partOneCompleteSwap = (value: boolean) => { + return { + type: SWAP_PART_ONE_COMPLETE, + value + }; +}; diff --git a/common/actions/swapConstants.js b/common/actions/swapConstants.js index ca72fc2c..fe4cff5c 100644 --- a/common/actions/swapConstants.js +++ b/common/actions/swapConstants.js @@ -3,3 +3,4 @@ export const SWAP_DESTINATION_KIND = 'SWAP_DESTINATION_KIND'; export const SWAP_ORIGIN_AMOUNT = 'SWAP_ORIGIN_AMOUNT'; export const SWAP_DESTINATION_AMOUNT = 'SWAP_DESTINATION_AMOUNT'; export const SWAP_UPDATE_BITY_RATES = 'SWAP_UPDATE_BITY_RATES'; +export const SWAP_PART_ONE_COMPLETE = 'SWAP_PART_ONE_COMPLETE'; diff --git a/common/reducers/swap.js b/common/reducers/swap.js index b827df05..06fbb2b9 100644 --- a/common/reducers/swap.js +++ b/common/reducers/swap.js @@ -3,15 +3,16 @@ import { SWAP_DESTINATION_KIND, SWAP_ORIGIN_AMOUNT, SWAP_ORIGIN_KIND, - SWAP_UPDATE_BITY_RATES + SWAP_UPDATE_BITY_RATES, + SWAP_PART_ONE_COMPLETE } from 'actions/swapConstants'; import { combineAndUpper } from 'api/bity'; export const ALL_CRYPTO_KIND_OPTIONS = ['BTC', 'ETH', 'REP']; const initialState = { - originAmount: 0, - destinationAmount: 0, + originAmount: '', + destinationAmount: '', originKind: 'BTC', destinationKind: 'ETH', destinationKindOptions: ALL_CRYPTO_KIND_OPTIONS.filter( @@ -20,6 +21,7 @@ const initialState = { originKindOptions: ALL_CRYPTO_KIND_OPTIONS.filter( element => element !== 'REP' ), + partOneComplete: false, bityRates: {} }; @@ -94,6 +96,11 @@ export function swap(state = initialState, action) { ...action.value } }; + case SWAP_PART_ONE_COMPLETE: + return { + ...state, + partOneComplete: action.value + }; default: return state; }