diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-20 05:58:06 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-20 05:58:06 +0800 |
commit | 41104b2d457b9b662122c139ee83bb8d0f519a51 (patch) | |
tree | 4743803be2564e0e5221b9a41e2c293a6fe52dd9 /packages/website/ts/utils/utils.ts | |
parent | 2930537a512bdaa74181fea74ce6befdf5b305b4 (diff) | |
parent | c39ac903a972930d538f8fa3292c658201b1c5e5 (diff) | |
download | dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.gz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.bz2 dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.lz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.xz dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.tar.zst dexon-sol-tools-41104b2d457b9b662122c139ee83bb8d0f519a51.zip |
Merge branch 'development' into createWethPage
* development: (27 commits)
Remove re-assignment
Fix scrolling topBar on Portal
Fix overflow issue on calculated fillAmount
Fix faulty import
Introduce an identityCommandBuilder
Define types for methodID
Define types for ethereumjs-abi
Install types for yargs
Fix comments
Fix linter issues
Fix linter error
Rename SubscriptionOpts to BlockRange
Refactor remaining _.assign to spread operator
Move muiTheme into it's own module
Refactor configs and constants, standardize on uppercase/snakecase, alphebetize, rename for logical grouping
Sort colors into color spectrum
remove unused style
standarize on `grey` over `gray` spelling and other color related fixes
Standardize colors to always be in uppercase hex and consolidate material-ui greys
Consolidate all custom colors and material-ui colors into a colors module
...
# Conflicts:
# packages/website/ts/components/eth_wrappers.tsx
# packages/website/ts/components/portal.tsx
# packages/website/ts/utils/configs.ts
# packages/website/ts/utils/constants.ts
Diffstat (limited to 'packages/website/ts/utils/utils.ts')
-rw-r--r-- | packages/website/ts/utils/utils.ts | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index abc2fb2d4..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'; @@ -61,8 +62,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 +73,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 +84,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(), @@ -124,11 +125,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 { @@ -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'; |