From 22c4ee6ef709610155191c4b0629ba0c41ce908f Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 17 Dec 2017 19:35:24 -0500 Subject: Update first two string enums to native type --- packages/website/ts/utils/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index abc2fb2d4..a6f80c2ab 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -61,8 +61,8 @@ export const utils = { orderExpiryTimestamp: BigNumber, orderTakerAddress: string, orderMakerAddress: string, makerFee: BigNumber, takerFee: BigNumber, feeRecipient: string, signatureData: SignatureData, tokenByAddress: TokenByAddress, orderSalt: BigNumber): Order { - const makerToken = tokenByAddress[sideToAssetToken[Side.deposit].address]; - const takerToken = tokenByAddress[sideToAssetToken[Side.receive].address]; + const makerToken = tokenByAddress[sideToAssetToken[Side.Deposit].address]; + const takerToken = tokenByAddress[sideToAssetToken[Side.Receive].address]; const order = { maker: { address: orderMakerAddress, @@ -72,7 +72,7 @@ export const utils = { decimals: makerToken.decimals, address: makerToken.address, }, - amount: sideToAssetToken[Side.deposit].amount.toString(), + amount: sideToAssetToken[Side.Deposit].amount.toString(), feeAmount: makerFee.toString(), }, taker: { @@ -83,7 +83,7 @@ export const utils = { decimals: takerToken.decimals, address: takerToken.address, }, - amount: sideToAssetToken[Side.receive].amount.toString(), + amount: sideToAssetToken[Side.Receive].amount.toString(), feeAmount: takerFee.toString(), }, expiration: orderExpiryTimestamp.toString(), -- cgit v1.2.3 From abbad68eb838ec4611d2236a7b0036a4a4d3058e Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 17 Dec 2017 20:48:23 -0500 Subject: Replace remaining strEnums with property TS string enums --- packages/website/ts/utils/typedoc_utils.ts | 4 ++-- packages/website/ts/utils/utils.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/typedoc_utils.ts b/packages/website/ts/utils/typedoc_utils.ts index 9d3b9f8d7..ed8834a87 100644 --- a/packages/website/ts/utils/typedoc_utils.ts +++ b/packages/website/ts/utils/typedoc_utils.ts @@ -22,7 +22,7 @@ export const typeDocUtils = { isType(entity: TypeDocNode): boolean { return entity.kindString === KindString.Interface || entity.kindString === KindString.Function || - entity.kindString === KindString['Type alias'] || + entity.kindString === KindString.TypeAlias || entity.kindString === KindString.Variable || entity.kindString === KindString.Enumeration; }, @@ -126,7 +126,7 @@ export const typeDocUtils = { case KindString.Function: case KindString.Variable: case KindString.Enumeration: - case KindString['Type alias']: + case KindString.TypeAlias: if (docsInfo.isPublicType(entity.name)) { const customType = typeDocUtils._convertCustomType( entity, docsInfo.sections, sectionName, docsInfo.subPackageName); diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index a6f80c2ab..211a56d45 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -124,11 +124,11 @@ export const utils = { // This logic mirrors the CSS media queries in BassCSS for the `lg-`, `md-` and `sm-` CSS // class prefixes. Do not edit these. if (widthInEm > LG_MIN_EM) { - return ScreenWidths.LG; + return ScreenWidths.Lg; } else if (widthInEm > MD_MIN_EM) { - return ScreenWidths.MD; + return ScreenWidths.Md; } else { - return ScreenWidths.SM; + return ScreenWidths.Sm; } }, isUserOnMobile(): boolean { -- cgit v1.2.3 From df9d3e3e16e5a00ea84369691c46a6e4a6a53049 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 18 Dec 2017 09:15:12 +0100 Subject: Consolidate all custom colors and material-ui colors into a colors module --- packages/website/ts/utils/colors.ts | 30 ++++++++++++++++++++++++++++++ packages/website/ts/utils/constants.ts | 1 - 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 packages/website/ts/utils/colors.ts (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts new file mode 100644 index 000000000..c6a8547d1 --- /dev/null +++ b/packages/website/ts/utils/colors.ts @@ -0,0 +1,30 @@ +import {colors as materialUiColors} from 'material-ui/styles'; + +export const colors = { + ...materialUiColors, + offWhite: 'rgb(245, 245, 245)', + beigeWhite: '#E4E4E4', + grayishPink: 'rgb(230, 229, 229)', + lightestGray: '#F0F0F0', + lightGray: '#BBBBBB', + gray: '#A5A5A5', + darkGray: '#818181', + darkerGray: '#393939', + heroGray: '#404040', + projectsGray: '#343333', + landingLinkGray: '#919191', + darkestGray: 'rgb(39, 39, 39)', + dharmaDarkGray: 'rgb(37, 37, 37)', + lightBlue: '#60a4f4', + darkBlue: '#4D5481', + lightPurple: '#a81ca6', + purple: '#690596', + red: '#e91751', + turquois: '#058789', + orange: '#e69d00', + lightestGreen: 'rgb(137, 199, 116)', + lightGreen: 'rgb(77, 197, 92)', + limeGreen: 'rgb(102, 222, 117)', + green: '#4da24b', + brightGreen: 'rgb(0, 195, 62)', +}; diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index fb81dd9a9..f001181ce 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -26,7 +26,6 @@ export const constants = { BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', BITLY_ENDPOINT: 'https://api-ssl.bitly.com', BLOG_URL: 'https://blog.0xproject.com/latest', - CUSTOM_BLUE: '#60a4f4', DEFAULT_DERIVATION_PATH: `44'/60'/0'`, ETHER_FAUCET_ENDPOINT: 'https://faucet.0xproject.com', FEE_RECIPIENT_ADDRESS: '0x0000000000000000000000000000000000000000', -- cgit v1.2.3 From 445ff1e28ee572236ec963a27bff227e859f685c Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 18 Dec 2017 10:06:16 +0100 Subject: Standardize colors to always be in uppercase hex and consolidate material-ui greys --- packages/website/ts/utils/colors.ts | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts index c6a8547d1..886cfe64e 100644 --- a/packages/website/ts/utils/colors.ts +++ b/packages/website/ts/utils/colors.ts @@ -2,29 +2,27 @@ import {colors as materialUiColors} from 'material-ui/styles'; export const colors = { ...materialUiColors, - offWhite: 'rgb(245, 245, 245)', beigeWhite: '#E4E4E4', - grayishPink: 'rgb(230, 229, 229)', - lightestGray: '#F0F0F0', - lightGray: '#BBBBBB', + grayishPink: '#E6E5E5', + lightGrey: '#BBBBBB', gray: '#A5A5A5', darkGray: '#818181', darkerGray: '#393939', heroGray: '#404040', projectsGray: '#343333', landingLinkGray: '#919191', - darkestGray: 'rgb(39, 39, 39)', - dharmaDarkGray: 'rgb(37, 37, 37)', - lightBlue: '#60a4f4', + darkestGray: '#272727', + dharmaDarkGray: '#252525', + lightBlue: '#60A4F4', darkBlue: '#4D5481', - lightPurple: '#a81ca6', + lightPurple: '#A81CA6', purple: '#690596', - red: '#e91751', + red: '#E91751', turquois: '#058789', - orange: '#e69d00', - lightestGreen: 'rgb(137, 199, 116)', - lightGreen: 'rgb(77, 197, 92)', - limeGreen: 'rgb(102, 222, 117)', - green: '#4da24b', - brightGreen: 'rgb(0, 195, 62)', + orange: '#E69D00', + lightestGreen: '#89C774', + lightGreen: '#4DC55C', + limeGreen: '#66DE75', + green: '#4DA24B', + brightGreen: '#00C33E', }; -- cgit v1.2.3 From 1aed970ce3468306f3bedbfdc29669d42e487441 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 18 Dec 2017 10:28:34 +0100 Subject: standarize on `grey` over `gray` spelling and other color related fixes --- packages/website/ts/utils/colors.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts index 886cfe64e..5523f581e 100644 --- a/packages/website/ts/utils/colors.ts +++ b/packages/website/ts/utils/colors.ts @@ -3,16 +3,17 @@ import {colors as materialUiColors} from 'material-ui/styles'; export const colors = { ...materialUiColors, beigeWhite: '#E4E4E4', - grayishPink: '#E6E5E5', + greyishPink: '#E6E5E5', + lightestGrey: '#F0F0F0', lightGrey: '#BBBBBB', - gray: '#A5A5A5', - darkGray: '#818181', - darkerGray: '#393939', - heroGray: '#404040', - projectsGray: '#343333', - landingLinkGray: '#919191', - darkestGray: '#272727', - dharmaDarkGray: '#252525', + grey: '#A5A5A5', + darkGrey: '#818181', + darkerGrey: '#393939', + heroGrey: '#404040', + projectsGrey: '#343333', + landingLinkGrey: '#919191', + darkestGrey: '#272727', + dharmaDarkGrey: '#252525', lightBlue: '#60A4F4', darkBlue: '#4D5481', lightPurple: '#A81CA6', -- cgit v1.2.3 From 400228e139a5c74302f1a16b8ca5c43ea4843307 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 18 Dec 2017 10:44:55 +0100 Subject: Sort colors into color spectrum --- packages/website/ts/utils/colors.ts | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/colors.ts b/packages/website/ts/utils/colors.ts index 5523f581e..c65a3a622 100644 --- a/packages/website/ts/utils/colors.ts +++ b/packages/website/ts/utils/colors.ts @@ -2,28 +2,42 @@ import {colors as materialUiColors} from 'material-ui/styles'; export const colors = { ...materialUiColors, - beigeWhite: '#E4E4E4', - greyishPink: '#E6E5E5', + grey50: '#FAFAFA', + grey100: '#F5F5F5', lightestGrey: '#F0F0F0', + greyishPink: '#E6E5E5', + grey300: '#E0E0E0', + beigeWhite: '#E4E4E4', + grey400: '#BDBDBD', lightGrey: '#BBBBBB', + grey500: '#9E9E9E', grey: '#A5A5A5', darkGrey: '#818181', + landingLinkGrey: '#919191', + grey700: '#616161', + grey800: '#424242', darkerGrey: '#393939', heroGrey: '#404040', projectsGrey: '#343333', - landingLinkGrey: '#919191', darkestGrey: '#272727', dharmaDarkGrey: '#252525', lightBlue: '#60A4F4', + lightBlueA700: '#0091EA', darkBlue: '#4D5481', + turquois: '#058789', lightPurple: '#A81CA6', purple: '#690596', + red200: '#EF9A9A', red: '#E91751', - turquois: '#058789', - orange: '#E69D00', - lightestGreen: '#89C774', - lightGreen: '#4DC55C', + red500: '#F44336', + red600: '#E53935', limeGreen: '#66DE75', - green: '#4DA24B', + lightGreen: '#4DC55C', + lightestGreen: '#89C774', brightGreen: '#00C33E', + green400: '#66BB6A', + green: '#4DA24B', + amber600: '#FFB300', + orange: '#E69D00', + amber800: '#FF8F00', }; -- cgit v1.2.3 From fb0b7efc4563c7c561866ab8691361ce6919160b Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 18 Dec 2017 19:30:25 +0100 Subject: Refactor configs and constants, standardize on uppercase/snakecase, alphebetize, rename for logical grouping --- packages/website/ts/utils/configs.ts | 109 ++++++++++++-- packages/website/ts/utils/constants.ts | 222 ++++++++-------------------- packages/website/ts/utils/error_reporter.ts | 2 +- packages/website/ts/utils/utils.ts | 9 +- 4 files changed, 164 insertions(+), 178 deletions(-) (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/configs.ts b/packages/website/ts/utils/configs.ts index 4a08929cf..8921c68a4 100644 --- a/packages/website/ts/utils/configs.ts +++ b/packages/website/ts/utils/configs.ts @@ -1,25 +1,102 @@ import * as _ from 'lodash'; import { + ContractAddresses, Environments, + Networks, OutdatedWrappedEtherByNetworkId, + PublicNodeUrlsByNetworkId, + SmartContractDocSections, } from 'ts/types'; const BASE_URL = window.location.origin; -const isDevelopment = _.includes(BASE_URL, 'https://0xproject.dev:3572') || - _.includes(BASE_URL, 'https://localhost:3572') || - _.includes(BASE_URL, 'https://127.0.0.1'); +const isDevelopment = _.includes([ + 'https://0xproject.localhost:3572', + 'https://localhost:3572', + 'https://127.0.0.1', + ], BASE_URL); +const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; export const configs = { - BASE_URL, - ENVIRONMENT: isDevelopment ? Environments.DEVELOPMENT : Environments.PRODUCTION, BACKEND_BASE_URL: isDevelopment ? 'https://localhost:3001' : 'https://website-api.0xproject.com', - symbolsOfMintableTokens: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], + BASE_URL, + BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', + CONTRACT_ADDRESS: { + '1.0.0': { + [Networks.mainnet]: { + [SmartContractDocSections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093', + [SmartContractDocSections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4', + [SmartContractDocSections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498', + [SmartContractDocSections.EtherToken]: '0x2956356cd2a2bf3202f771f50d3d14a367b48070', + [SmartContractDocSections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c', + }, + [Networks.ropsten]: { + [SmartContractDocSections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac', + [SmartContractDocSections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', + [SmartContractDocSections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', + [SmartContractDocSections.EtherToken]: '0xc00fd9820cd2898cc4c054b7bf142de637ad129a', + [SmartContractDocSections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed', + }, + [Networks.kovan]: { + [SmartContractDocSections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', + [SmartContractDocSections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4', + [SmartContractDocSections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', + [SmartContractDocSections.EtherToken]: '0x05d090b51c40b020eab3bfcb6a2dff130df22e9c', + [SmartContractDocSections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f', + }, + }, + } as ContractAddresses, + DEFAULT_DERIVATION_PATH: `44'/60'/0'`, // WARNING: ZRX & WETH MUST always be default trackedTokens - defaultTrackedTokenSymbols: ['WETH', 'ZRX'], - lastLocalStorageFillClearanceDate: '2017-11-22', - lastLocalStorageTrackedTokenClearanceDate: '2017-12-13', - isMainnetEnabled: true, - outdatedWrappedEthers: [ + DEFAULT_TRACKED_TOKEN_SYMBOLS: ['WETH', 'ZRX'], + DOMAIN_STAGING: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', + DOMAIN_DEVELOPMENT: '0xproject.localhost:3572', + DOMAIN_PRODUCTION: '0xproject.com', + ENVIRONMENT: isDevelopment ? Environments.DEVELOPMENT : Environments.PRODUCTION, + ICON_URL_BY_SYMBOL: { + 'REP': '/images/token_icons/augur.png', + 'DGD': '/images/token_icons/digixdao.png', + 'WETH': '/images/token_icons/ether_erc20.png', + 'MLN': '/images/token_icons/melon.png', + 'GNT': '/images/token_icons/golem.png', + 'MKR': '/images/token_icons/makerdao.png', + 'ZRX': '/images/token_icons/zero_ex.png', + 'ANT': '/images/token_icons/aragon.png', + 'BNT': '/images/token_icons/bancor.png', + 'BAT': '/images/token_icons/basicattentiontoken.png', + 'CVC': '/images/token_icons/civic.png', + 'EOS': '/images/token_icons/eos.png', + 'FUN': '/images/token_icons/funfair.png', + 'GNO': '/images/token_icons/gnosis.png', + 'ICN': '/images/token_icons/iconomi.png', + 'OMG': '/images/token_icons/omisego.png', + 'SNT': '/images/token_icons/status.png', + 'STORJ': '/images/token_icons/storjcoinx.png', + 'PAY': '/images/token_icons/tenx.png', + 'QTUM': '/images/token_icons/qtum.png', + 'DNT': '/images/token_icons/district0x.png', + 'SNGLS': '/images/token_icons/singularity.png', + 'EDG': '/images/token_icons/edgeless.png', + '1ST': '/images/token_icons/firstblood.jpg', + 'WINGS': '/images/token_icons/wings.png', + 'BQX': '/images/token_icons/bitquence.png', + 'LUN': '/images/token_icons/lunyr.png', + 'RLC': '/images/token_icons/iexec.png', + 'MCO': '/images/token_icons/monaco.png', + 'ADT': '/images/token_icons/adtoken.png', + 'CFI': '/images/token_icons/cofound-it.png', + 'ROL': '/images/token_icons/etheroll.png', + 'WGNT': '/images/token_icons/golem.png', + 'MTL': '/images/token_icons/metal.png', + 'NMR': '/images/token_icons/numeraire.png', + 'SAN': '/images/token_icons/santiment.png', + 'TAAS': '/images/token_icons/taas.png', + 'TKN': '/images/token_icons/tokencard.png', + 'TRST': '/images/token_icons/trust.png', + } as {[symbol: string]: string}, + IS_MAINNET_ENABLED: true, + LAST_LOCAL_STORAGE_FILL_CLEARANCE_DATE: '2017-11-22', + LAST_LOCAL_STORAGE_TRACKED_TOKEN_CLEARANCE_DATE: '2017-12-13', + OUTDATED_WRAPPED_ETHERS: [ { 42: { address: '0x05d090b51c40b020eab3bfcb6a2dff130df22e9c', @@ -37,4 +114,14 @@ export const configs = { }, }, ] as OutdatedWrappedEtherByNetworkId[], + // The order matters. We first try first node and only then fall back to others. + PUBLIC_NODE_URLS_BY_NETWORK_ID: { + [1]: [ + `https://mainnet.infura.io/${INFURA_API_KEY}`, + ], + [42]: [ + `https://kovan.infura.io/${INFURA_API_KEY}`, + ], + } as PublicNodeUrlsByNetworkId, + SYMBOLS_OF_MINTABLE_TOKENS: ['MKR', 'MLN', 'GNT', 'DGD', 'REP'], }; diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts index f001181ce..0e4a1056a 100644 --- a/packages/website/ts/utils/constants.ts +++ b/packages/website/ts/utils/constants.ts @@ -1,187 +1,85 @@ import BigNumber from 'bignumber.js'; import { - ContractAddresses, - Docs, Networks, - PublicNodeUrlsByNetworkId, - WebsitePaths, } from 'ts/types'; -const INFURA_API_KEY = 'T5WSC8cautR4KXyYgsRs'; -const smartContractDocSections = { - Introduction: 'Introduction', - Exchange: 'Exchange', - TokenTransferProxy: 'TokenTransferProxy', - TokenRegistry: 'TokenRegistry', - ZRXToken: 'ZRXToken', - EtherToken: 'EtherToken', -}; - export const constants = { - ANGELLIST_URL: 'https://angel.co/0xproject/jobs', - STAGING_DOMAIN: 'staging-0xproject.s3-website-us-east-1.amazonaws.com', - PRODUCTION_DOMAIN: '0xproject.com', - DEVELOPMENT_DOMAIN: '0xproject.dev:3572', - BIGNUMBERJS_GITHUB_URL: 'http://mikemcl.github.io/bignumber.js', - BITLY_ACCESS_TOKEN: 'ffc4c1a31e5143848fb7c523b39f91b9b213d208', - BITLY_ENDPOINT: 'https://api-ssl.bitly.com', - BLOG_URL: 'https://blog.0xproject.com/latest', - DEFAULT_DERIVATION_PATH: `44'/60'/0'`, - ETHER_FAUCET_ENDPOINT: 'https://faucet.0xproject.com', - FEE_RECIPIENT_ADDRESS: '0x0000000000000000000000000000000000000000', - FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/', - GITHUB_URL: 'https://github.com/0xProject', - GITHUB_WIKI_URL: 'https://github.com/0xProject/wiki', - HTTP_NO_CONTENT_STATUS_CODE: 204, - ACCEPT_DISCLAIMER_LOCAL_STORAGE_KEY: 'didAcceptPortalDisclaimer', - LINKEDIN_0X_URL: 'https://www.linkedin.com/company/0x', - LEDGER_PROVIDER_NAME: 'Ledger', - METAMASK_PROVIDER_NAME: 'Metamask', + DECIMAL_PLACES_ETH: 18, + DECIMAL_PLACES_ZRX: 18, + DOCS_SCROLL_DURATION_MS: 0, + DOCS_CONTAINER_ID: 'documentation', GENESIS_ORDER_BLOCK_BY_NETWORK_ID: { 1: 4145578, 42: 3117574, 50: 0, } as {[networkId: number]: number}, - PUBLIC_PROVIDER_NAME: '0x Public', - // The order matters. We first try first node and only then fall back to others. - PUBLIC_NODE_URLS_BY_NETWORK_ID: { - [1]: [ - `https://mainnet.infura.io/${INFURA_API_KEY}`, - ], - [42]: [ - `https://kovan.infura.io/${INFURA_API_KEY}`, - ], - } as PublicNodeUrlsByNetworkId, - PARITY_SIGNER_PROVIDER_NAME: 'Parity Signer', - GENERIC_PROVIDER_NAME: 'Injected Web3', + HOME_SCROLL_DURATION_MS: 500, + HTTP_NO_CONTENT_STATUS_CODE: 204, + LOCAL_STORAGE_KEY_ACCEPT_DISCLAIMER: 'didAcceptPortalDisclaimer', MAKER_FEE: new BigNumber(0), MAINNET_NAME: 'Main network', - MAINNET_NETWORK_ID: 1, - METAMASK_CHROME_STORE_URL: 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn', - // tslint:disable-next-line:max-line-length - PARITY_CHROME_STORE_URL: 'https://chrome.google.com/webstore/detail/parity-ethereum-integrati/himekenlppkgeaoeddcliojfddemadig', - MIST_DOWNLOAD_URL: 'https://github.com/ethereum/mist/releases', - NULL_ADDRESS: '0x0000000000000000000000000000000000000000', - ROLLBAR_ACCESS_TOKEN: 'a6619002b51c4464928201e6ea94de65', - DOCS_SCROLL_DURATION_MS: 0, - DOCS_CONTAINER_ID: 'documentation', - HOME_SCROLL_DURATION_MS: 500, - REDDIT_URL: 'https://reddit.com/r/0xproject', - STANDARD_RELAYER_API_GITHUB: 'https://github.com/0xProject/standard-relayer-api/blob/master/README.md', - SUCCESS_STATUS: 200, - UNAVAILABLE_STATUS: 503, - TAKER_FEE: new BigNumber(0), - TESTNET_NAME: 'Kovan', - TESTNET_NETWORK_ID: 42, - TESTRPC_NETWORK_ID: 50, - TWITTER_URL: 'https://twitter.com/0xproject', - ETH_DECIMAL_PLACES: 18, MINT_AMOUNT: new BigNumber('100000000000000000000'), - WEB3_DOCS_URL: 'https://github.com/ethereum/wiki/wiki/JavaScript-API', - WEB3_PROVIDER_DOCS_URL: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L150', - WEB3_DECODED_LOG_ENTRY_EVENT_URL: - 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L123', - WEB3_LOG_ENTRY_EVENT_URL: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L127', - ZEROEX_CHAT_URL: 'https://chat.0xproject.com', - // Projects - ETHFINEX_URL: 'https://www.bitfinex.com/ethfinex', - RADAR_RELAY_URL: 'https://radarrelay.com', - PARADEX_URL: 'https://paradex.io', - DYDX_URL: 'https://dydx.exchange', - MELONPORT_URL: 'https://melonport.com', - DISTRICT_0X_URL: 'https://district0x.io', - DHARMA_URL: 'https://dharma.io', - LENDROID_URL: 'https://lendroid.com', - MAKER_URL: 'https://makerdao.com', - ARAGON_URL: 'https://aragon.one', - BLOCKNET_URL: 'https://blocknet.co', - OCEAN_URL: 'http://the0cean.com', - STATUS_URL: 'https://status.im', - AUGUR_URL: 'https://augur.net', - AUCTUS_URL: 'https://auctus.org', - OPEN_ANX_URL: 'https://www.openanx.org', - - iconUrlBySymbol: { - 'REP': '/images/token_icons/augur.png', - 'DGD': '/images/token_icons/digixdao.png', - 'WETH': '/images/token_icons/ether_erc20.png', - 'MLN': '/images/token_icons/melon.png', - 'GNT': '/images/token_icons/golem.png', - 'MKR': '/images/token_icons/makerdao.png', - 'ZRX': '/images/token_icons/zero_ex.png', - 'ANT': '/images/token_icons/aragon.png', - 'BNT': '/images/token_icons/bancor.png', - 'BAT': '/images/token_icons/basicattentiontoken.png', - 'CVC': '/images/token_icons/civic.png', - 'EOS': '/images/token_icons/eos.png', - 'FUN': '/images/token_icons/funfair.png', - 'GNO': '/images/token_icons/gnosis.png', - 'ICN': '/images/token_icons/iconomi.png', - 'OMG': '/images/token_icons/omisego.png', - 'SNT': '/images/token_icons/status.png', - 'STORJ': '/images/token_icons/storjcoinx.png', - 'PAY': '/images/token_icons/tenx.png', - 'QTUM': '/images/token_icons/qtum.png', - 'DNT': '/images/token_icons/district0x.png', - 'SNGLS': '/images/token_icons/singularity.png', - 'EDG': '/images/token_icons/edgeless.png', - '1ST': '/images/token_icons/firstblood.jpg', - 'WINGS': '/images/token_icons/wings.png', - 'BQX': '/images/token_icons/bitquence.png', - 'LUN': '/images/token_icons/lunyr.png', - 'RLC': '/images/token_icons/iexec.png', - 'MCO': '/images/token_icons/monaco.png', - 'ADT': '/images/token_icons/adtoken.png', - 'CFI': '/images/token_icons/cofound-it.png', - 'ROL': '/images/token_icons/etheroll.png', - 'WGNT': '/images/token_icons/golem.png', - 'MTL': '/images/token_icons/metal.png', - 'NMR': '/images/token_icons/numeraire.png', - 'SAN': '/images/token_icons/santiment.png', - 'TAAS': '/images/token_icons/taas.png', - 'TKN': '/images/token_icons/tokencard.png', - 'TRST': '/images/token_icons/trust.png', - } as {[symbol: string]: string}, - networkNameById: { + NETWORK_ID_MAINNET: 1, + NETWORK_ID_TESTNET: 42, + NETWORK_ID_TESTRPC: 50, + NETWORK_NAME_BY_ID: { 1: Networks.mainnet, 3: Networks.ropsten, 4: Networks.rinkeby, 42: Networks.kovan, } as {[symbol: number]: string}, - networkIdByName: { + NETWORK_ID_BY_NAME: { [Networks.mainnet]: 1, [Networks.ropsten]: 3, [Networks.rinkeby]: 4, [Networks.kovan]: 42, } as {[networkName: string]: number}, - docToPath: { - [Docs.ZeroExJs]: WebsitePaths.ZeroExJs, - [Docs.SmartContracts]: WebsitePaths.SmartContracts, - }, - smartContractDocSections, - contractAddresses: { - '1.0.0': { - [Networks.mainnet]: { - [smartContractDocSections.Exchange]: '0x12459c951127e0c374ff9105dda097662a027093', - [smartContractDocSections.TokenTransferProxy]: '0x8da0d80f5007ef1e431dd2127178d224e32c2ef4', - [smartContractDocSections.ZRXToken]: '0xe41d2489571d322189246dafa5ebde1f4699f498', - [smartContractDocSections.EtherToken]: '0x2956356cd2a2bf3202f771f50d3d14a367b48070', - [smartContractDocSections.TokenRegistry]: '0x926a74c5c36adf004c87399e65f75628b0f98d2c', - }, - [Networks.ropsten]: { - [smartContractDocSections.Exchange]: '0x479cc461fecd078f766ecc58533d6f69580cf3ac', - [smartContractDocSections.TokenTransferProxy]: '0x4e9aad8184de8833365fea970cd9149372fdf1e6', - [smartContractDocSections.ZRXToken]: '0xa8e9fa8f91e5ae138c74648c9c304f1c75003a8d', - [smartContractDocSections.EtherToken]: '0xc00fd9820cd2898cc4c054b7bf142de637ad129a', - [smartContractDocSections.TokenRegistry]: '0x6b1a50f0bb5a7995444bd3877b22dc89c62843ed', - }, - [Networks.kovan]: { - [smartContractDocSections.Exchange]: '0x90fe2af704b34e0224bf2299c838e04d4dcf1364', - [smartContractDocSections.TokenTransferProxy]: '0x087Eed4Bc1ee3DE49BeFbd66C662B434B15d49d4', - [smartContractDocSections.ZRXToken]: '0x6ff6c0ff1d68b964901f986d4c9fa3ac68346570', - [smartContractDocSections.EtherToken]: '0x05d090b51c40b020eab3bfcb6a2dff130df22e9c', - [smartContractDocSections.TokenRegistry]: '0xf18e504561f4347bea557f3d4558f559dddbae7f', - }, - }, - } as ContractAddresses, + NULL_ADDRESS: '0x0000000000000000000000000000000000000000', + PROVIDER_NAME_LEDGER: 'Ledger', + PROVIDER_NAME_METAMASK: 'Metamask', + PROVIDER_NAME_PARITY_SIGNER: 'Parity Signer', + PROVIDER_NAME_GENERIC: 'Injected Web3', + PROVIDER_NAME_PUBLIC: '0x Public', + ROLLBAR_ACCESS_TOKEN: 'a6619002b51c4464928201e6ea94de65', + SUCCESS_STATUS: 200, + UNAVAILABLE_STATUS: 503, + TAKER_FEE: new BigNumber(0), + TESTNET_NAME: 'Kovan', + PROJECT_URL_ETHFINEX: 'https://www.bitfinex.com/ethfinex', + PROJECT_URL_RADAR_RELAY: 'https://radarrelay.com', + PROJECT_URL_PARADEX: 'https://paradex.io', + PROJECT_URL_DYDX: 'https://dydx.exchange', + PROJECT_URL_MELONPORT: 'https://melonport.com', + PROJECT_URL_DISTRICT_0X: 'https://district0x.io', + PROJECT_URL_DHARMA: 'https://dharma.io', + PROJECT_URL_LENDROID: 'https://lendroid.com', + PROJECT_URL_MAKER: 'https://makerdao.com', + PROJECT_URL_ARAGON: 'https://aragon.one', + PROJECT_URL_BLOCKNET: 'https://blocknet.co', + PROJECT_URL_0CEAN: 'http://the0cean.com', + PROJECT_URL_STATUS: 'https://status.im', + PROJECT_URL_AUGUR: 'https://augur.net', + PROJECT_URL_AUCTUS: 'https://auctus.org', + PROJECT_URL_OPEN_ANX: 'https://www.openanx.org', + URL_ANGELLIST: 'https://angel.co/0xproject/jobs', + URL_BIGNUMBERJS_GITHUB: 'http://mikemcl.github.io/bignumber.js', + URL_BITLY_API: 'https://api-ssl.bitly.com', + URL_BLOG: 'https://blog.0xproject.com/latest', + URL_FIREFOX_U2F_ADDON: 'https://addons.mozilla.org/en-US/firefox/addon/u2f-support-add-on/', + URL_ETHER_FAUCET: 'https://faucet.0xproject.com', + URL_GITHUB_ORG: 'https://github.com/0xProject', + URL_GITHUB_WIKI: 'https://github.com/0xProject/wiki', + URL_METAMASK_CHROME_STORE: 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn', + URL_MIST_DOWNLOAD: 'https://github.com/ethereum/mist/releases', + URL_PARITY_CHROME_STORE: + 'https://chrome.google.com/webstore/detail/parity-ethereum-integrati/himekenlppkgeaoeddcliojfddemadig', + URL_REDDIT: 'https://reddit.com/r/0xproject', + URL_STANDARD_RELAYER_API_GITHUB: 'https://github.com/0xProject/standard-relayer-api/blob/master/README.md', + URL_TWITTER: 'https://twitter.com/0xproject', + URL_WEB3_DOCS: 'https://github.com/ethereum/wiki/wiki/JavaScript-API', + URL_WEB3_DECODED_LOG_ENTRY_EVENT: + 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L123', + URL_WEB3_LOG_ENTRY_EVENT: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L127', + URL_WEB3_PROVIDER_DOCS: 'https://github.com/0xProject/web3-typescript-typings/blob/f5bcb96/index.d.ts#L150', + URL_ZEROEX_CHAT: 'https://chat.0xproject.com', }; diff --git a/packages/website/ts/utils/error_reporter.ts b/packages/website/ts/utils/error_reporter.ts index 40991afbf..67be117e0 100644 --- a/packages/website/ts/utils/error_reporter.ts +++ b/packages/website/ts/utils/error_reporter.ts @@ -15,7 +15,7 @@ const rollbarConfig = { environment: configs.ENVIRONMENT, }, uncaughtErrorLevel: 'error', - hostWhiteList: [constants.PRODUCTION_DOMAIN, constants.STAGING_DOMAIN], + hostWhiteList: [configs.DOMAIN_PRODUCTION, configs.DOMAIN_STAGING], ignoredMessages: [ // Errors from the third-party scripts 'Script error', diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index 211a56d45..36cc8f77b 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -15,6 +15,7 @@ import { Token, TokenByAddress, } from 'ts/types'; +import {configs} from 'ts/utils/configs'; import {constants} from 'ts/utils/constants'; import * as u2f from 'ts/vendor/u2f_api'; @@ -136,7 +137,7 @@ export const utils = { return isUserOnMobile; }, getEtherScanLinkIfExists(addressOrTxHash: string, networkId: number, suffix: EtherscanLinkSuffixes): string { - const networkName = constants.networkNameById[networkId]; + const networkName = constants.NETWORK_NAME_BY_ID[networkId]; if (_.isUndefined(networkName)) { return undefined; } @@ -182,11 +183,11 @@ export const utils = { }, getCurrentEnvironment() { switch (location.host) { - case constants.DEVELOPMENT_DOMAIN: + case configs.DOMAIN_DEVELOPMENT: return 'development'; - case constants.STAGING_DOMAIN: + case configs.DOMAIN_STAGING: return 'staging'; - case constants.PRODUCTION_DOMAIN: + case configs.DOMAIN_PRODUCTION: return 'production'; default: return 'production'; -- cgit v1.2.3 From c6af59a3e72d09a123a89e63e0b4ed932c5c9e99 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 19 Dec 2017 11:18:02 +0100 Subject: Move muiTheme into it's own module --- packages/website/ts/utils/mui_theme.ts | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/website/ts/utils/mui_theme.ts (limited to 'packages/website/ts/utils') diff --git a/packages/website/ts/utils/mui_theme.ts b/packages/website/ts/utils/mui_theme.ts new file mode 100644 index 000000000..60c58f595 --- /dev/null +++ b/packages/website/ts/utils/mui_theme.ts @@ -0,0 +1,35 @@ +import {getMuiTheme} from 'material-ui/styles'; +import {colors} from 'ts/utils/colors'; + +export const muiTheme = getMuiTheme({ + appBar: { + height: 45, + color: colors.white, + textColor: colors.black, + }, + palette: { + pickerHeaderColor: colors.lightBlue, + primary1Color: colors.lightBlue, + primary2Color: colors.lightBlue, + textColor: colors.grey700, + }, + datePicker: { + color: colors.grey700, + textColor: colors.white, + calendarTextColor: colors.white, + selectColor: colors.darkestGrey, + selectTextColor: colors.white, + }, + timePicker: { + color: colors.grey700, + textColor: colors.white, + accentColor: colors.white, + headerColor: colors.darkestGrey, + selectColor: colors.darkestGrey, + selectTextColor: colors.darkestGrey, + }, + toggle: { + thumbOnColor: colors.limeGreen, + trackOnColor: colors.lightGreen, + }, +}); -- cgit v1.2.3