From 948d62200a23b4da59278f976e9757cfc3c9234e Mon Sep 17 00:00:00 2001 From: fragosti Date: Thu, 25 Oct 2018 18:53:16 -0700 Subject: feat: change network to networkId --- packages/instant/public/index.html | 2 +- packages/instant/src/components/zero_ex_instant.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'packages') diff --git a/packages/instant/public/index.html b/packages/instant/public/index.html index 0ee144a28..9f1dfdb64 100644 --- a/packages/instant/public/index.html +++ b/packages/instant/public/index.html @@ -62,7 +62,7 @@ const renderOptionsOverrides = { liquiditySource: liquiditySourceOverride === 'provided' ? [providedOrder] : liquiditySourceOverride, assetData: queryParams.getQueryParamValue('assetData'), - network: +queryParams.getQueryParamValue('network') || undefined, + networkId: +queryParams.getQueryParamValue('networkId') || undefined, defaultAssetBuyAmount: +queryParams.getQueryParamValue('defaultAssetBuyAmount') || undefined, } const renderOptions = Object.assign({}, renderOptionsDefaults, removeUndefined(renderOptionsOverrides)); diff --git a/packages/instant/src/components/zero_ex_instant.tsx b/packages/instant/src/components/zero_ex_instant.tsx index bf7cc9de5..8454de43c 100644 --- a/packages/instant/src/components/zero_ex_instant.tsx +++ b/packages/instant/src/components/zero_ex_instant.tsx @@ -31,17 +31,17 @@ export interface ZeroExInstantRequiredProps { export interface ZeroExInstantOptionalProps { defaultAssetBuyAmount?: number; additionalAssetMetaDataMap: ObjectMap; - network: Network; + networkId: Network; } export class ZeroExInstant extends React.Component { private readonly _store: Store; private static _mergeInitialStateWithProps(props: ZeroExInstantProps, state: State = INITIAL_STATE): State { - const network = props.network || state.network; + const networkId = props.networkId || state.network; // TODO: Provider needs to not be hard-coded to injected web3. const provider = getProvider(); const assetBuyerOptions = { - networkId: network, + networkId, }; let assetBuyer; if (_.isString(props.liquiditySource)) { @@ -60,8 +60,8 @@ export class ZeroExInstant extends React.Component { const storeStateFromProps: State = { ...state, assetBuyer, - network, - selectedAsset: assetUtils.createAssetFromAssetData(props.assetData, completeAssetMetaDataMap, network), + network: networkId, + selectedAsset: assetUtils.createAssetFromAssetData(props.assetData, completeAssetMetaDataMap, networkId), selectedAssetAmount: _.isUndefined(props.defaultAssetBuyAmount) ? state.selectedAssetAmount : new BigNumber(props.defaultAssetBuyAmount), -- cgit v1.2.3