diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-13 22:29:12 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-13 22:29:12 +0800 |
commit | ca25b816fabe15ce1ebc539c0316beba813683b8 (patch) | |
tree | 0e28bbc819cfccda1789192628c365ea54328103 /packages/react-shared/src/ts/utils | |
parent | df1968157c13a7bbe2e512cbc924190a414e6738 (diff) | |
download | dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar.gz dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar.bz2 dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar.lz dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar.xz dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.tar.zst dexon-0x-contracts-ca25b816fabe15ce1ebc539c0316beba813683b8.zip |
move scripts to monorepro-scripts
Diffstat (limited to 'packages/react-shared/src/ts/utils')
-rw-r--r-- | packages/react-shared/src/ts/utils/colors.ts | 48 | ||||
-rw-r--r-- | packages/react-shared/src/ts/utils/constants.ts | 20 | ||||
-rw-r--r-- | packages/react-shared/src/ts/utils/utils.ts | 45 |
3 files changed, 0 insertions, 113 deletions
diff --git a/packages/react-shared/src/ts/utils/colors.ts b/packages/react-shared/src/ts/utils/colors.ts deleted file mode 100644 index 2eead95c7..000000000 --- a/packages/react-shared/src/ts/utils/colors.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { colors as materialUiColors } from 'material-ui/styles'; - -export const colors = { - ...materialUiColors, - gray40: '#F8F8F8', - grey50: '#FAFAFA', - grey100: '#F5F5F5', - lightestGrey: '#F0F0F0', - greyishPink: '#E6E5E5', - grey300: '#E0E0E0', - beigeWhite: '#E4E4E4', - grey350: '#cacaca', - grey400: '#BDBDBD', - lightGrey: '#BBBBBB', - grey500: '#9E9E9E', - grey: '#A5A5A5', - darkGrey: '#818181', - landingLinkGrey: '#919191', - grey700: '#616161', - grey750: '#515151', - grey800: '#424242', - darkerGrey: '#393939', - heroGrey: '#404040', - projectsGrey: '#343333', - darkestGrey: '#272727', - dharmaDarkGrey: '#252525', - lightBlue: '#60A4F4', - lightBlueA700: '#0091EA', - linkBlue: '#1D5CDE', - darkBlue: '#4D5481', - turquois: '#058789', - lightPurple: '#A81CA6', - purple: '#690596', - red200: '#EF9A9A', - red: '#E91751', - red500: '#F44336', - red600: '#E53935', - limeGreen: '#66DE75', - lightGreen: '#4DC55C', - lightestGreen: '#89C774', - brightGreen: '#00C33E', - green400: '#66BB6A', - green: '#4DA24B', - amber600: '#FFB300', - orange: '#E69D00', - amber800: '#FF8F00', - darkYellow: '#caca03', -}; diff --git a/packages/react-shared/src/ts/utils/constants.ts b/packages/react-shared/src/ts/utils/constants.ts deleted file mode 100644 index 562ab776b..000000000 --- a/packages/react-shared/src/ts/utils/constants.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Networks } from '../types'; - -export const constants = { - DOCS_SCROLL_DURATION_MS: 0, - DOCS_CONTAINER_ID: 'documentation', - SCROLL_CONTAINER_ID: 'documentation', - SCROLL_TOP_ID: 'pageScrollTop', - NETWORK_NAME_BY_ID: { - 1: Networks.Mainnet, - 3: Networks.Ropsten, - 4: Networks.Rinkeby, - 42: Networks.Kovan, - } as { [symbol: number]: string }, - NETWORK_ID_BY_NAME: { - [Networks.Mainnet]: 1, - [Networks.Ropsten]: 3, - [Networks.Rinkeby]: 4, - [Networks.Kovan]: 42, - } as { [networkName: string]: number }, -}; diff --git a/packages/react-shared/src/ts/utils/utils.ts b/packages/react-shared/src/ts/utils/utils.ts deleted file mode 100644 index b3acb081e..000000000 --- a/packages/react-shared/src/ts/utils/utils.ts +++ /dev/null @@ -1,45 +0,0 @@ -import isMobile = require('is-mobile'); -import * as _ from 'lodash'; -import { scroller } from 'react-scroll'; - -import { EtherscanLinkSuffixes, Networks } from '../types'; - -import { constants } from './constants'; - -export const utils = { - setUrlHash(anchorId: string) { - window.location.hash = anchorId; - }, - scrollToHash(hash: string, containerId: string): void { - let finalHash = hash; - if (_.isEmpty(hash)) { - finalHash = constants.SCROLL_TOP_ID; // scroll to the top - } - - scroller.scrollTo(finalHash, { - duration: 0, - offset: 0, - containerId, - }); - }, - isUserOnMobile(): boolean { - const isUserOnMobile = isMobile(); - return isUserOnMobile; - }, - getIdFromName(name: string) { - const id = name.replace(/ /g, '-'); - return id; - }, - getEtherScanLinkIfExists( - addressOrTxHash: string, - networkId: number, - suffix: EtherscanLinkSuffixes, - ): string | undefined { - const networkName = constants.NETWORK_NAME_BY_ID[networkId]; - if (_.isUndefined(networkName)) { - return undefined; - } - const etherScanPrefix = networkName === Networks.Mainnet ? '' : `${networkName.toLowerCase()}.`; - return `https://${etherScanPrefix}etherscan.io/${suffix}/${addressOrTxHash}`; - }, -}; |