Remove unused enums
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
||||
ActionTypes,
|
||||
AssetToken,
|
||||
BlockchainErrs,
|
||||
Direction,
|
||||
Order,
|
||||
ProviderType,
|
||||
ScreenWidths,
|
||||
@@ -43,12 +42,6 @@ export class Dispatcher {
|
||||
type: ActionTypes.SWAP_ASSET_TOKENS,
|
||||
});
|
||||
}
|
||||
public updateGenerateOrderStep(direction: Direction) {
|
||||
this.dispatch({
|
||||
data: direction,
|
||||
type: ActionTypes.UPDATE_GENERATE_ORDER_STEP,
|
||||
});
|
||||
}
|
||||
public updateOrderSalt(salt: BigNumber) {
|
||||
this.dispatch({
|
||||
data: salt,
|
||||
|
||||
@@ -5,8 +5,6 @@ import {
|
||||
Action,
|
||||
ActionTypes,
|
||||
BlockchainErrs,
|
||||
Direction,
|
||||
GenerateOrderSteps,
|
||||
Order,
|
||||
ProviderType,
|
||||
ScreenWidths,
|
||||
@@ -28,7 +26,6 @@ export interface State {
|
||||
// Portal
|
||||
blockchainErr: BlockchainErrs;
|
||||
blockchainIsLoaded: boolean;
|
||||
generateOrderStep: GenerateOrderSteps;
|
||||
networkId: number;
|
||||
orderExpiryTimestamp: BigNumber;
|
||||
orderFillAmount: BigNumber;
|
||||
@@ -60,7 +57,6 @@ const INITIAL_STATE: State = {
|
||||
// Portal
|
||||
blockchainErr: BlockchainErrs.NoError,
|
||||
blockchainIsLoaded: false,
|
||||
generateOrderStep: GenerateOrderSteps.ChooseAssets,
|
||||
networkId: undefined,
|
||||
orderExpiryTimestamp: utils.initialOrderExpiryUnixTimestampSec(),
|
||||
orderFillAmount: undefined,
|
||||
@@ -259,19 +255,6 @@ export function reducer(state: State = INITIAL_STATE, action: Action) {
|
||||
});
|
||||
}
|
||||
|
||||
case ActionTypes.UPDATE_GENERATE_ORDER_STEP: {
|
||||
const direction = action.data;
|
||||
let nextGenerateOrderStep = state.generateOrderStep;
|
||||
if (direction === Direction.forward) {
|
||||
nextGenerateOrderStep += 1;
|
||||
} else if (state.generateOrderStep !== 0) {
|
||||
nextGenerateOrderStep -= 1;
|
||||
}
|
||||
return _.assign({}, state, {
|
||||
generateOrderStep: nextGenerateOrderStep,
|
||||
});
|
||||
}
|
||||
|
||||
case ActionTypes.UPDATE_CHOSEN_ASSET_TOKEN: {
|
||||
const newSideToAssetToken = _.assign({}, state.sideToAssetToken, {
|
||||
[action.data.side]: action.data.token,
|
||||
|
||||
@@ -10,25 +10,11 @@ function strEnum(values: string[]): {[key: string]: string} {
|
||||
}, Object.create(null));
|
||||
}
|
||||
|
||||
export enum GenerateOrderSteps {
|
||||
ChooseAssets,
|
||||
GrantAllowance,
|
||||
RemainingConfigs,
|
||||
SignTransaction,
|
||||
CopyAndShare,
|
||||
}
|
||||
|
||||
export enum Side {
|
||||
Receive = 'RECEIVE',
|
||||
Deposit = 'DEPOSIT',
|
||||
}
|
||||
|
||||
export const Direction = strEnum([
|
||||
'forward',
|
||||
'backward',
|
||||
]);
|
||||
export type Direction = keyof typeof Direction;
|
||||
|
||||
export interface Token {
|
||||
iconUrl?: string;
|
||||
name: string;
|
||||
@@ -141,7 +127,6 @@ export const ActionTypes = strEnum([
|
||||
'CLEAR_TOKEN_BY_ADDRESS',
|
||||
'UPDATE_BLOCKCHAIN_IS_LOADED',
|
||||
'UPDATE_NETWORK_ID',
|
||||
'UPDATE_GENERATE_ORDER_STEP',
|
||||
'UPDATE_CHOSEN_ASSET_TOKEN',
|
||||
'UPDATE_CHOSEN_ASSET_TOKEN_ADDRESS',
|
||||
'UPDATE_ORDER_TAKER_ADDRESS',
|
||||
|
||||
Reference in New Issue
Block a user