From 21046e4349a130efc186845948c06ebdcadd892c Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 16 Nov 2018 17:19:09 -0800 Subject: chore: make instant public --- packages/instant/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/package.json b/packages/instant/package.json index bddc88d18..a44c3c050 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -5,7 +5,6 @@ "node": ">=6.12" }, "description": "0x Instant React Component", - "private": true, "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { @@ -98,6 +97,6 @@ "webpack-dev-server": "^3.1.9" }, "publishConfig": { - "access": "private" + "access": "public" } } -- cgit From 302d172aad0a9b1c1aac6b2652cbd4088412675a Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 16 Nov 2018 17:50:47 -0800 Subject: feat: fix instant build and add to project references --- packages/instant/tsconfig.json | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/tsconfig.json b/packages/instant/tsconfig.json index 28a6190b8..14b0ad8f7 100644 --- a/packages/instant/tsconfig.json +++ b/packages/instant/tsconfig.json @@ -2,16 +2,11 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "lib", - "rootDir": ".", + "rootDir": "src", "jsx": "react", - "allowSyntheticDefaultImports": true, "noImplicitAny": true, - "module": "ESNext", - "moduleResolution": "node", - "lib": ["es2015", "dom"], - "target": "es5", - "sourceMap": true + "allowSyntheticDefaultImports": true }, - "include": ["./src/**/*", "./test/**/*"], + "include": ["./src/**/*"], "exclude": ["./src/index.umd.ts"] } -- cgit From 4caacc78a1cbf287b88543355efdfb86a2d3d801 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 16 Nov 2018 18:05:32 -0800 Subject: fix: specify new location of index.js in package.json --- packages/instant/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/package.json b/packages/instant/package.json index a44c3c050..185fd7faa 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -5,8 +5,8 @@ "node": ">=6.12" }, "description": "0x Instant React Component", - "main": "lib/src/index.js", - "types": "lib/src/index.d.ts", + "main": "lib/index.js", + "types": "lib/index.d.ts", "scripts": { "build": "yarn build:all", "build:all": "run-p build:umd:prod build:commonjs", -- cgit From 9ab55fd07d3a11616d12c95ef512f100d12a0aee Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 19 Nov 2018 16:22:05 -0800 Subject: fix: npmignore file ignoring index.d.ts --- packages/instant/.npmignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/instant') diff --git a/packages/instant/.npmignore b/packages/instant/.npmignore index 579d65af0..a4f7810c0 100644 --- a/packages/instant/.npmignore +++ b/packages/instant/.npmignore @@ -1,5 +1,5 @@ .* * */ -!lib/src/**/* +!lib/**/* !umd/**/* \ No newline at end of file -- cgit From 3169b724064c1495b27c67ec92aeb7314a18e177 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Mon, 19 Nov 2018 17:04:15 -0800 Subject: fix(instant): Don't allow changing of assets when order processing --- packages/instant/src/components/erc20_asset_amount_input.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 520ac33d5..371e0b0d5 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -53,6 +53,7 @@ export class ERC20AssetAmountInput extends React.Component @@ -74,11 +75,11 @@ export class ERC20AssetAmountInput extends React.Component {assetUtils.formattedSymbolForAsset(asset)} - {this._renderChevronIcon()} + {isEnabled && this._renderChevronIcon()} -- cgit From 6de499459cb29f74cabd91c441f85e4c2325a6d7 Mon Sep 17 00:00:00 2001 From: fragosti Date: Mon, 19 Nov 2018 17:10:47 -0800 Subject: fix: do not use document on import --- packages/instant/src/components/zero_ex_instant_provider.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/zero_ex_instant_provider.tsx b/packages/instant/src/components/zero_ex_instant_provider.tsx index 8be53ee20..ac246128c 100644 --- a/packages/instant/src/components/zero_ex_instant_provider.tsx +++ b/packages/instant/src/components/zero_ex_instant_provider.tsx @@ -19,8 +19,6 @@ import { Heartbeater } from '../util/heartbeater'; import { generateAccountHeartbeater, generateBuyQuoteHeartbeater } from '../util/heartbeater_factory'; import { providerStateFactory } from '../util/provider_state_factory'; -fonts.include(); - export type ZeroExInstantProviderProps = ZeroExInstantProviderRequiredProps & Partial; @@ -86,6 +84,7 @@ export class ZeroExInstantProvider extends React.Component Date: Tue, 20 Nov 2018 09:51:14 -0800 Subject: Allow user to select other token on success --- packages/instant/src/components/erc20_asset_amount_input.tsx | 6 +++--- .../instant/src/containers/selected_erc20_asset_amount_input.ts | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 371e0b0d5..e675d3fc5 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -23,6 +23,7 @@ export interface ERC20AssetAmountInputProps { startingFontSizePx: number; fontColor?: ColorOption; isDisabled: boolean; + canSelectOtherAsset: boolean; numberOfAssetsAvailable?: number; } @@ -53,7 +54,6 @@ export class ERC20AssetAmountInput extends React.Component @@ -75,11 +75,11 @@ export class ERC20AssetAmountInput extends React.Component {assetUtils.formattedSymbolForAsset(asset)} - {isEnabled && this._renderChevronIcon()} + {this.props.canSelectOtherAsset && this._renderChevronIcon()} diff --git a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts index 2c2661e1a..bbc103566 100644 --- a/packages/instant/src/containers/selected_erc20_asset_amount_input.ts +++ b/packages/instant/src/containers/selected_erc20_asset_amount_input.ts @@ -26,6 +26,7 @@ interface ConnectedState { isDisabled: boolean; numberOfAssetsAvailable?: number; affiliateInfo?: AffiliateInfo; + canSelectOtherAsset: boolean; } interface ConnectedDispatch { @@ -50,6 +51,11 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP ? (state.selectedAsset as ERC20Asset) : undefined; const numberOfAssetsAvailable = _.isUndefined(state.availableAssets) ? undefined : state.availableAssets.length; + const canSelectOtherAsset = + numberOfAssetsAvailable && numberOfAssetsAvailable > 1 + ? isEnabled || processState === OrderProcessState.Success + : false; + const assetBuyer = state.providerState.assetBuyer; return { assetBuyer, @@ -58,6 +64,7 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP isDisabled, numberOfAssetsAvailable, affiliateInfo: state.affiliateInfo, + canSelectOtherAsset, }; }; @@ -104,6 +111,7 @@ const mergeProps = ( }, isDisabled: connectedState.isDisabled, numberOfAssetsAvailable: connectedState.numberOfAssetsAvailable, + canSelectOtherAsset: connectedState.canSelectOtherAsset, }; }; -- cgit From b7eb2e887d636e2ed61eade4bae01596dba4b4c2 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 13:59:09 -0800 Subject: isDisabled -> isInputDisabled --- packages/instant/src/components/erc20_asset_amount_input.tsx | 7 ++++--- .../src/containers/selected_erc20_asset_amount_input.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index e675d3fc5..b825255c4 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -22,7 +22,7 @@ export interface ERC20AssetAmountInputProps { onSelectAssetClick?: (asset?: ERC20Asset) => void; startingFontSizePx: number; fontColor?: ColorOption; - isDisabled: boolean; + isInputDisabled: boolean; canSelectOtherAsset: boolean; numberOfAssetsAvailable?: number; } @@ -51,14 +51,15 @@ export class ERC20AssetAmountInput extends React.Component { - const { onChange, ...rest } = this.props; - const amountBorderBottom = this.props.isDisabled ? '' : `1px solid ${transparentWhite}`; + const { onChange, isInputDisabled, ...rest } = this.props; + const amountBorderBottom = isInputDisabled ? '' : `1px solid ${transparentWhite}`; const onSymbolClick = this._generateSelectAssetClickHandler(); return ( { const processState = state.buyOrderState.processState; - const isEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure; - const isDisabled = !isEnabled; + const isInputEnabled = processState === OrderProcessState.None || processState === OrderProcessState.Failure; + const isInputDisabled = !isInputEnabled; const selectedAsset = !_.isUndefined(state.selectedAsset) && state.selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20 ? (state.selectedAsset as ERC20Asset) @@ -53,7 +53,7 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP const numberOfAssetsAvailable = _.isUndefined(state.availableAssets) ? undefined : state.availableAssets.length; const canSelectOtherAsset = numberOfAssetsAvailable && numberOfAssetsAvailable > 1 - ? isEnabled || processState === OrderProcessState.Success + ? isInputEnabled || processState === OrderProcessState.Success : false; const assetBuyer = state.providerState.assetBuyer; @@ -61,7 +61,7 @@ const mapStateToProps = (state: State, _ownProps: SelectedERC20AssetAmountInputP assetBuyer, value: state.selectedAssetUnitAmount, asset: selectedAsset, - isDisabled, + isInputDisabled, numberOfAssetsAvailable, affiliateInfo: state.affiliateInfo, canSelectOtherAsset, @@ -109,7 +109,7 @@ const mergeProps = ( onChange: (value, asset) => { connectedDispatch.updateBuyQuote(connectedState.assetBuyer, value, asset, connectedState.affiliateInfo); }, - isDisabled: connectedState.isDisabled, + isInputDisabled: connectedState.isInputDisabled, numberOfAssetsAvailable: connectedState.numberOfAssetsAvailable, canSelectOtherAsset: connectedState.canSelectOtherAsset, }; -- cgit From 1a7b167f63144df73a974250b4aa089960149505 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 14:18:12 -0800 Subject: fix(instant): Use new valid svg image for instant --- packages/instant/src/assets/powered_by_0x.svg | 42 ++++++++++----------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/assets/powered_by_0x.svg b/packages/instant/src/assets/powered_by_0x.svg index f49238a3c..e3d007d0b 100644 --- a/packages/instant/src/assets/powered_by_0x.svg +++ b/packages/instant/src/assets/powered_by_0x.svg @@ -1,27 +1,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + -- cgit