From 004e197863e4df942d21f9e4ed629c08eeadad56 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 14 Nov 2018 16:01:16 -0800 Subject: feat(instant): add icons to token selector --- packages/instant/package.json | 1 + packages/instant/src/assets/icons/ae.svg | 4 ++++ packages/instant/src/assets/icons/agi.svg | 5 +++++ packages/instant/src/assets/icons/ant.svg | 5 +++++ packages/instant/src/assets/icons/ast.svg | 4 ++++ packages/instant/src/assets/icons/bat.svg | 3 +++ packages/instant/src/assets/icons/cvc.svg | 4 ++++ packages/instant/src/assets/icons/dai.svg | 5 +++++ packages/instant/src/assets/icons/dgd.svg | 5 +++++ packages/instant/src/assets/icons/dgx.svg | 4 ++++ packages/instant/src/assets/icons/dnt.svg | 4 ++++ packages/instant/src/assets/icons/fun.svg | 4 ++++ packages/instant/src/assets/icons/gno.svg | 6 ++++++ packages/instant/src/assets/icons/gnt.svg | 3 +++ packages/instant/src/assets/icons/knc.svg | 6 ++++++ packages/instant/src/assets/icons/link.svg | 6 ++++++ packages/instant/src/assets/icons/lpt.svg | 8 ++++++++ packages/instant/src/assets/icons/mana.svg | 8 ++++++++ packages/instant/src/assets/icons/mkr.svg | 4 ++++ packages/instant/src/assets/icons/mln.svg | 4 ++++ packages/instant/src/assets/icons/omg.svg | 3 +++ packages/instant/src/assets/icons/powr.svg | 6 ++++++ packages/instant/src/assets/icons/ren.svg | 12 ++++++++++++ packages/instant/src/assets/icons/rep.svg | 7 +++++++ packages/instant/src/assets/icons/req.svg | 3 +++ packages/instant/src/assets/icons/salt.svg | 3 +++ packages/instant/src/assets/icons/snt.svg | 4 ++++ packages/instant/src/assets/icons/spank.svg | 6 ++++++ packages/instant/src/assets/icons/wax.svg | 4 ++++ packages/instant/src/assets/icons/zil.svg | 3 +++ packages/instant/src/assets/icons/zrx.svg | 3 +++ packages/instant/src/components/erc20_token_selector.tsx | 15 ++++++++++----- packages/instant/src/data/asset_meta_data_map.ts | 4 +--- packages/instant/webpack.config.js | 4 ++++ 34 files changed, 162 insertions(+), 8 deletions(-) create mode 100644 packages/instant/src/assets/icons/ae.svg create mode 100644 packages/instant/src/assets/icons/agi.svg create mode 100644 packages/instant/src/assets/icons/ant.svg create mode 100644 packages/instant/src/assets/icons/ast.svg create mode 100644 packages/instant/src/assets/icons/bat.svg create mode 100644 packages/instant/src/assets/icons/cvc.svg create mode 100644 packages/instant/src/assets/icons/dai.svg create mode 100644 packages/instant/src/assets/icons/dgd.svg create mode 100644 packages/instant/src/assets/icons/dgx.svg create mode 100644 packages/instant/src/assets/icons/dnt.svg create mode 100644 packages/instant/src/assets/icons/fun.svg create mode 100644 packages/instant/src/assets/icons/gno.svg create mode 100644 packages/instant/src/assets/icons/gnt.svg create mode 100644 packages/instant/src/assets/icons/knc.svg create mode 100644 packages/instant/src/assets/icons/link.svg create mode 100644 packages/instant/src/assets/icons/lpt.svg create mode 100644 packages/instant/src/assets/icons/mana.svg create mode 100644 packages/instant/src/assets/icons/mkr.svg create mode 100644 packages/instant/src/assets/icons/mln.svg create mode 100644 packages/instant/src/assets/icons/omg.svg create mode 100644 packages/instant/src/assets/icons/powr.svg create mode 100644 packages/instant/src/assets/icons/ren.svg create mode 100644 packages/instant/src/assets/icons/rep.svg create mode 100644 packages/instant/src/assets/icons/req.svg create mode 100644 packages/instant/src/assets/icons/salt.svg create mode 100644 packages/instant/src/assets/icons/snt.svg create mode 100644 packages/instant/src/assets/icons/spank.svg create mode 100644 packages/instant/src/assets/icons/wax.svg create mode 100644 packages/instant/src/assets/icons/zil.svg create mode 100644 packages/instant/src/assets/icons/zrx.svg (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index 6caa3902b..669272cb1 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -89,6 +89,7 @@ "npm-run-all": "^4.1.2", "nyc": "^11.0.1", "shx": "^0.2.2", + "svg-react-loader": "^0.4.6", "ts-jest": "^23.10.3", "tslint": "5.11.0", "typedoc": "0.13.0", diff --git a/packages/instant/src/assets/icons/ae.svg b/packages/instant/src/assets/icons/ae.svg new file mode 100644 index 000000000..592400d1a --- /dev/null +++ b/packages/instant/src/assets/icons/ae.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/agi.svg b/packages/instant/src/assets/icons/agi.svg new file mode 100644 index 000000000..9ed9784a4 --- /dev/null +++ b/packages/instant/src/assets/icons/agi.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/instant/src/assets/icons/ant.svg b/packages/instant/src/assets/icons/ant.svg new file mode 100644 index 000000000..ed7e1491a --- /dev/null +++ b/packages/instant/src/assets/icons/ant.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/instant/src/assets/icons/ast.svg b/packages/instant/src/assets/icons/ast.svg new file mode 100644 index 000000000..8136fb688 --- /dev/null +++ b/packages/instant/src/assets/icons/ast.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/bat.svg b/packages/instant/src/assets/icons/bat.svg new file mode 100644 index 000000000..9b69ddf9d --- /dev/null +++ b/packages/instant/src/assets/icons/bat.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/cvc.svg b/packages/instant/src/assets/icons/cvc.svg new file mode 100644 index 000000000..bddc90e16 --- /dev/null +++ b/packages/instant/src/assets/icons/cvc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/dai.svg b/packages/instant/src/assets/icons/dai.svg new file mode 100644 index 000000000..901d522ca --- /dev/null +++ b/packages/instant/src/assets/icons/dai.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/instant/src/assets/icons/dgd.svg b/packages/instant/src/assets/icons/dgd.svg new file mode 100644 index 000000000..371f89584 --- /dev/null +++ b/packages/instant/src/assets/icons/dgd.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/packages/instant/src/assets/icons/dgx.svg b/packages/instant/src/assets/icons/dgx.svg new file mode 100644 index 000000000..2e4a90a5d --- /dev/null +++ b/packages/instant/src/assets/icons/dgx.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/dnt.svg b/packages/instant/src/assets/icons/dnt.svg new file mode 100644 index 000000000..7d5459343 --- /dev/null +++ b/packages/instant/src/assets/icons/dnt.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/fun.svg b/packages/instant/src/assets/icons/fun.svg new file mode 100644 index 000000000..bb4347df2 --- /dev/null +++ b/packages/instant/src/assets/icons/fun.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/gno.svg b/packages/instant/src/assets/icons/gno.svg new file mode 100644 index 000000000..ebf6290cf --- /dev/null +++ b/packages/instant/src/assets/icons/gno.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/instant/src/assets/icons/gnt.svg b/packages/instant/src/assets/icons/gnt.svg new file mode 100644 index 000000000..7315ce459 --- /dev/null +++ b/packages/instant/src/assets/icons/gnt.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/knc.svg b/packages/instant/src/assets/icons/knc.svg new file mode 100644 index 000000000..70d35bc2f --- /dev/null +++ b/packages/instant/src/assets/icons/knc.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/instant/src/assets/icons/link.svg b/packages/instant/src/assets/icons/link.svg new file mode 100644 index 000000000..2fddf7ef1 --- /dev/null +++ b/packages/instant/src/assets/icons/link.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/instant/src/assets/icons/lpt.svg b/packages/instant/src/assets/icons/lpt.svg new file mode 100644 index 000000000..cbe4f2202 --- /dev/null +++ b/packages/instant/src/assets/icons/lpt.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/instant/src/assets/icons/mana.svg b/packages/instant/src/assets/icons/mana.svg new file mode 100644 index 000000000..45be622e4 --- /dev/null +++ b/packages/instant/src/assets/icons/mana.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/packages/instant/src/assets/icons/mkr.svg b/packages/instant/src/assets/icons/mkr.svg new file mode 100644 index 000000000..e09d47444 --- /dev/null +++ b/packages/instant/src/assets/icons/mkr.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/mln.svg b/packages/instant/src/assets/icons/mln.svg new file mode 100644 index 000000000..a0b821c57 --- /dev/null +++ b/packages/instant/src/assets/icons/mln.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/omg.svg b/packages/instant/src/assets/icons/omg.svg new file mode 100644 index 000000000..a906509af --- /dev/null +++ b/packages/instant/src/assets/icons/omg.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/powr.svg b/packages/instant/src/assets/icons/powr.svg new file mode 100644 index 000000000..eb48342e1 --- /dev/null +++ b/packages/instant/src/assets/icons/powr.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/instant/src/assets/icons/ren.svg b/packages/instant/src/assets/icons/ren.svg new file mode 100644 index 000000000..fe563dee2 --- /dev/null +++ b/packages/instant/src/assets/icons/ren.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/packages/instant/src/assets/icons/rep.svg b/packages/instant/src/assets/icons/rep.svg new file mode 100644 index 000000000..1be1a6a88 --- /dev/null +++ b/packages/instant/src/assets/icons/rep.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/packages/instant/src/assets/icons/req.svg b/packages/instant/src/assets/icons/req.svg new file mode 100644 index 000000000..d9eb89634 --- /dev/null +++ b/packages/instant/src/assets/icons/req.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/salt.svg b/packages/instant/src/assets/icons/salt.svg new file mode 100644 index 000000000..f2892c981 --- /dev/null +++ b/packages/instant/src/assets/icons/salt.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/snt.svg b/packages/instant/src/assets/icons/snt.svg new file mode 100644 index 000000000..34b2c432b --- /dev/null +++ b/packages/instant/src/assets/icons/snt.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/spank.svg b/packages/instant/src/assets/icons/spank.svg new file mode 100644 index 000000000..1d7320770 --- /dev/null +++ b/packages/instant/src/assets/icons/spank.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/packages/instant/src/assets/icons/wax.svg b/packages/instant/src/assets/icons/wax.svg new file mode 100644 index 000000000..8bcb73015 --- /dev/null +++ b/packages/instant/src/assets/icons/wax.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/instant/src/assets/icons/zil.svg b/packages/instant/src/assets/icons/zil.svg new file mode 100644 index 000000000..1a9218201 --- /dev/null +++ b/packages/instant/src/assets/icons/zil.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/assets/icons/zrx.svg b/packages/instant/src/assets/icons/zrx.svg new file mode 100644 index 000000000..07518f551 --- /dev/null +++ b/packages/instant/src/assets/icons/zrx.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/instant/src/components/erc20_token_selector.tsx b/packages/instant/src/components/erc20_token_selector.tsx index e4d8749a9..62dd52a4c 100644 --- a/packages/instant/src/components/erc20_token_selector.tsx +++ b/packages/instant/src/components/erc20_token_selector.tsx @@ -79,6 +79,7 @@ class TokenSelectorRow extends React.Component { public render(): React.ReactNode { const { token } = this.props; const displaySymbol = assetUtils.bestNameForAsset(token); + const TokenIcon = require(`../assets/icons/${token.metaData.symbol}.svg`); return ( { - - - - {displaySymbol} - + + + {!_.isUndefined(TokenIcon) ? ( + + ) : ( + + {displaySymbol} + + )} diff --git a/packages/instant/src/data/asset_meta_data_map.ts b/packages/instant/src/data/asset_meta_data_map.ts index 6ecb9af85..b24c9c83d 100644 --- a/packages/instant/src/data/asset_meta_data_map.ts +++ b/packages/instant/src/data/asset_meta_data_map.ts @@ -2,8 +2,6 @@ import { AssetProxyId, ObjectMap } from '@0x/types'; import { AssetMetaData } from '../types'; -// Map from assetData string to AssetMetaData object -// TODO: import this from somewhere else. export const assetMetaDataMap: ObjectMap = { '0xf47261b0000000000000000000000000e41d2489571d322189246dafa5ebde1f4699f498': { assetProxyId: AssetProxyId.ERC20, @@ -85,7 +83,7 @@ export const assetMetaDataMap: ObjectMap = { '0xf47261b0000000000000000000000000e0b7927c4af23765cb51314a0e0521a9645f0e2a': { assetProxyId: AssetProxyId.ERC20, decimals: 9, - primaryColor: '#BC9952', + primaryColor: '#DEB564', symbol: 'dgd', name: 'DigixDao', }, diff --git a/packages/instant/webpack.config.js b/packages/instant/webpack.config.js index 3129e13a6..3c5cafc1d 100644 --- a/packages/instant/webpack.config.js +++ b/packages/instant/webpack.config.js @@ -20,6 +20,10 @@ const config = { test: /\.(ts|tsx)$/, loader: 'awesome-typescript-loader', }, + { + test: /\.svg$/, + loader: 'svg-react-loader', + }, ], }, devServer: { -- cgit v1.2.3 From 7534c0f19ef465f27d98014d306ada5d74693b43 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 15 Nov 2018 19:07:43 -0800 Subject: fix(asset-buyer): change lodash version to the same as other 0x packages --- packages/asset-buyer/CHANGELOG.json | 9 +++++++++ packages/asset-buyer/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/asset-buyer/CHANGELOG.json b/packages/asset-buyer/CHANGELOG.json index 0e4623d05..394f29ff6 100644 --- a/packages/asset-buyer/CHANGELOG.json +++ b/packages/asset-buyer/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "version": "3.0.1", + "changes": [ + { + "note": "Dependencies updated", + "pr": 1276 + } + ] + }, { "version": "3.0.0", "changes": [ diff --git a/packages/asset-buyer/package.json b/packages/asset-buyer/package.json index fad33476b..f6a331844 100644 --- a/packages/asset-buyer/package.json +++ b/packages/asset-buyer/package.json @@ -47,7 +47,7 @@ "@0x/utils": "^2.0.5", "@0x/web3-wrapper": "^3.1.4", "ethereum-types": "^1.1.2", - "lodash": "^4.17.10" + "lodash": "^4.17.5" }, "devDependencies": { "@0x/tslint-config": "^1.0.10", -- cgit v1.2.3 From f582cc327b3cc365ea0de0469adf2781b896c0e5 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Thu, 15 Nov 2018 19:08:24 -0800 Subject: fix(instant): change lodash version to the same as other 0x packages --- packages/instant/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index 6caa3902b..bb37d762d 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -57,7 +57,7 @@ "bowser": "^1.9.4", "copy-to-clipboard": "^3.0.8", "ethereum-types": "^1.1.2", - "lodash": "^4.17.10", + "lodash": "^4.17.5", "polished": "^2.2.0", "react": "^16.5.2", "react-dom": "^16.5.2", -- cgit v1.2.3 From 0a5364ff351b2d51603929c8c7255b877bfa12b0 Mon Sep 17 00:00:00 2001 From: Jacob Evans Date: Fri, 16 Nov 2018 21:20:48 +1100 Subject: feat: Deploy contracts to Rinkeby --- packages/contract-addresses/CHANGELOG.json | 8 ++++++++ packages/contract-addresses/src/index.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) (limited to 'packages') diff --git a/packages/contract-addresses/CHANGELOG.json b/packages/contract-addresses/CHANGELOG.json index 307d73545..86c6a5c31 100644 --- a/packages/contract-addresses/CHANGELOG.json +++ b/packages/contract-addresses/CHANGELOG.json @@ -1,4 +1,12 @@ [ + { + "version": "1.2.0", + "changes": [ + { + "note": "Rinkeby Deployment" + } + ] + }, { "version": "1.1.0", "changes": [ diff --git a/packages/contract-addresses/src/index.ts b/packages/contract-addresses/src/index.ts index f5fd8d0be..57358dd38 100644 --- a/packages/contract-addresses/src/index.ts +++ b/packages/contract-addresses/src/index.ts @@ -14,6 +14,7 @@ export interface ContractAddresses { export enum NetworkId { Mainnet = 1, Ropsten = 3, + Rinkeby = 4, Kovan = 42, } @@ -38,6 +39,16 @@ const networkToAddresses: { [networkId: number]: ContractAddresses } = { forwarder: '0x2240dab907db71e64d3e0dba4800c83b5c502d4e', orderValidator: '0x90431a90516ab49af23a0530e04e8c7836e7122f', }, + 4: { + erc20Proxy: '0x3e809c563c15a295e832e37053798ddc8d6c8dab', + erc721Proxy: '0x8e1ff02637cb5e39f2fa36c14706aa348b065b09', + zrxToken: '0x2727e688b8fd40b198cd5fe6e408e00494a06f07', + etherToken: '0xc778417e063141139fce010982780140aa0cd5ab', + exchange: '0x22ebc052f43a88efa06379426120718170f2204e', + assetProxyOwner: '0x1da52d1d3a3acfa0a1836b737393b4e9931268fc', + forwarder: '0xd2dbf3250a764eaaa94fa0c84ed87c0edc8ed04e', + orderValidator: '0x39c3fc9f4d8430af2713306ce80c584752d9e1c7', + }, 42: { erc20Proxy: '0xf1ec01d6236d3cd881a0bf0130ea25fe4234003e', erc721Proxy: '0x2a9127c745688a165106c11cd4d647d2220af821', -- cgit v1.2.3 From 6fe4aef6f7ca0102947de80c77c4852ed6dc5fad Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 16 Nov 2018 17:05:11 -0800 Subject: feat: refer to map file in postpublish configs --- packages/instant/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index 59e357765..a44c3c050 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -29,7 +29,7 @@ "postpublish": { "assets": [ "packages/instant/umd/instant.js", - "packages/instant/umd/instant.min.js" + "packages/instant/umd/instant.js.map" ] } }, -- cgit v1.2.3 From 1426145946ee9b9a674fdd6811c540c76f8e568d Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 16 Nov 2018 17:06:06 -0800 Subject: fix: make instant package private --- packages/instant/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/instant/package.json b/packages/instant/package.json index a44c3c050..bddc88d18 100644 --- a/packages/instant/package.json +++ b/packages/instant/package.json @@ -5,6 +5,7 @@ "node": ">=6.12" }, "description": "0x Instant React Component", + "private": true, "main": "lib/src/index.js", "types": "lib/src/index.d.ts", "scripts": { @@ -97,6 +98,6 @@ "webpack-dev-server": "^3.1.9" }, "publishConfig": { - "access": "public" + "access": "private" } } -- cgit v1.2.3 From 99541f89f7676f6b0d8a923ad377fa901a74f504 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 19 Nov 2018 17:07:18 +0000 Subject: Add 0x-order-utils.py library to developers home --- packages/website/ts/pages/documentation/docs_home.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages') diff --git a/packages/website/ts/pages/documentation/docs_home.tsx b/packages/website/ts/pages/documentation/docs_home.tsx index 9faa930fc..e3328f3fa 100644 --- a/packages/website/ts/pages/documentation/docs_home.tsx +++ b/packages/website/ts/pages/documentation/docs_home.tsx @@ -82,6 +82,15 @@ const CATEGORY_TO_PACKAGES: ObjectMap = { to: WebsitePaths.SmartContracts, }, }, + { + description: + "A Python library for interacting with 0x orders. Generate an orderHash, sign an order, validate it's signature and more.", + link: { + title: '0x-order-utils.py', + to: 'http://0x-order-utils-py.s3-website-us-east-1.amazonaws.com/', + shouldOpenInNewTab: true, + }, + }, { description: 'An http & websocket client for interacting with relayers that have implemented the [Standard Relayer API](https://github.com/0xProject/standard-relayer-api)', -- cgit v1.2.3 From 9b725a645db423d20a4be1f1d5930f6ecb7ad682 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 19 Nov 2018 10:12:40 -0800 Subject: feat(instant): support custom iconUrls --- .../src/components/erc20_token_selector.tsx | 34 ++++++++++++++++------ packages/instant/src/types.ts | 1 + 2 files changed, 26 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/components/erc20_token_selector.tsx b/packages/instant/src/components/erc20_token_selector.tsx index 62dd52a4c..1b1921acb 100644 --- a/packages/instant/src/components/erc20_token_selector.tsx +++ b/packages/instant/src/components/erc20_token_selector.tsx @@ -78,8 +78,8 @@ interface TokenSelectorRowProps { class TokenSelectorRow extends React.Component { public render(): React.ReactNode { const { token } = this.props; + const circleColor = token.metaData.primaryColor || 'black'; const displaySymbol = assetUtils.bestNameForAsset(token); - const TokenIcon = require(`../assets/icons/${token.metaData.symbol}.svg`); return ( { - + - {!_.isUndefined(TokenIcon) ? ( - - ) : ( - - {displaySymbol} - - )} + @@ -122,3 +116,25 @@ class TokenSelectorRow extends React.Component { this.props.onClick(this.props.token); }; } + +interface TokenSelectorRowIconProps { + token: ERC20Asset; +} + +const TokenSelectorRowIcon: React.StatelessComponent = props => { + const { token } = props; + const iconUrlIfExists = token.metaData.iconUrl; + const TokenIcon = require(`../assets/icons/${token.metaData.symbol}.svg`); + const displaySymbol = assetUtils.bestNameForAsset(token); + if (!_.isUndefined(iconUrlIfExists)) { + return ; + } else if (!_.isUndefined(TokenIcon)) { + return ; + } else { + return ( + + {displaySymbol} + + ); + } +}; diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts index 67f21a396..2d4a8a850 100644 --- a/packages/instant/src/types.ts +++ b/packages/instant/src/types.ts @@ -51,6 +51,7 @@ export interface ERC20AssetMetaData { primaryColor?: string; symbol: string; name: string; + iconUrl?: string; } export interface ERC721AssetMetaData { -- cgit v1.2.3