diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-19 02:30:25 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-19 02:30:25 +0800 |
commit | fb0b7efc4563c7c561866ab8691361ce6919160b (patch) | |
tree | dbbf76c091be331f8a44ed5b7569c7c4742f6fa3 /packages/website/ts/pages | |
parent | 400228e139a5c74302f1a16b8ca5c43ea4843307 (diff) | |
download | dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.tar.gz dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.tar.zst dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.zip |
Refactor configs and constants, standardize on uppercase/snakecase, alphebetize, rename for logical grouping
Diffstat (limited to 'packages/website/ts/pages')
-rw-r--r-- | packages/website/ts/pages/about/about.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/pages/documentation/documentation.tsx | 5 | ||||
-rw-r--r-- | packages/website/ts/pages/documentation/type.tsx | 10 | ||||
-rw-r--r-- | packages/website/ts/pages/faq/faq.tsx | 2 | ||||
-rw-r--r-- | packages/website/ts/pages/landing/landing.tsx | 34 | ||||
-rw-r--r-- | packages/website/ts/pages/wiki/wiki.tsx | 4 |
6 files changed, 29 insertions, 28 deletions
diff --git a/packages/website/ts/pages/about/about.tsx b/packages/website/ts/pages/about/about.tsx index 8c512ee5c..c2f291425 100644 --- a/packages/website/ts/pages/about/about.tsx +++ b/packages/website/ts/pages/about/about.tsx @@ -214,7 +214,7 @@ export class About extends React.Component<AboutProps, AboutState> { > We are seeking outstanding candidates to{' '} <a - href={constants.ANGELLIST_URL} + href={constants.URL_ANGELLIST} target="_blank" style={{color: 'black'}} > diff --git a/packages/website/ts/pages/documentation/documentation.tsx b/packages/website/ts/pages/documentation/documentation.tsx index 97e632452..aab14a52c 100644 --- a/packages/website/ts/pages/documentation/documentation.tsx +++ b/packages/website/ts/pages/documentation/documentation.tsx @@ -34,6 +34,7 @@ import { TypescriptMethod, } from 'ts/types'; import {colors} from 'ts/utils/colors'; +import {configs} from 'ts/utils/configs'; import {constants} from 'ts/utils/constants'; import {docUtils} from 'ts/utils/doc_utils'; import {utils} from 'ts/utils/utils'; @@ -270,7 +271,7 @@ export class Documentation extends ); } private renderNetworkBadgesIfExists(sectionName: string) { - const networkToAddressByContractName = constants.contractAddresses[this.props.docsVersion]; + const networkToAddressByContractName = configs.CONTRACT_ADDRESS[this.props.docsVersion]; const badges = _.map(networkToAddressByContractName, (addressByContractName: AddressByContractName, networkName: string) => { const contractAddress = addressByContractName[sectionName]; @@ -278,7 +279,7 @@ export class Documentation extends return null; } const linkIfExists = utils.getEtherScanLinkIfExists( - contractAddress, constants.networkIdByName[networkName], EtherscanLinkSuffixes.Address, + contractAddress, constants.NETWORK_ID_BY_NAME[networkName], EtherscanLinkSuffixes.Address, ); return ( <a diff --git a/packages/website/ts/pages/documentation/type.tsx b/packages/website/ts/pages/documentation/type.tsx index 37517afdc..0516a5c68 100644 --- a/packages/website/ts/pages/documentation/type.tsx +++ b/packages/website/ts/pages/documentation/type.tsx @@ -11,11 +11,11 @@ import {utils} from 'ts/utils/utils'; // Some types reference other libraries. For these types, we want to link the user to the relevant documentation. const typeToUrl: {[typeName: string]: string} = { - Web3: constants.WEB3_DOCS_URL, - Provider: constants.WEB3_PROVIDER_DOCS_URL, - BigNumber: constants.BIGNUMBERJS_GITHUB_URL, - DecodedLogEntryEvent: constants.WEB3_DECODED_LOG_ENTRY_EVENT_URL, - LogEntryEvent: constants.WEB3_LOG_ENTRY_EVENT_URL, + Web3: constants.URL_WEB3_DOCS, + Provider: constants.URL_WEB3_PROVIDER_DOCS, + BigNumber: constants.URL_BIGNUMBERJS_GITHUB, + DecodedLogEntryEvent: constants.URL_WEB3_DECODED_LOG_ENTRY_EVENT, + LogEntryEvent: constants.URL_WEB3_LOG_ENTRY_EVENT, }; const typePrefix: {[typeName: string]: string} = { diff --git a/packages/website/ts/pages/faq/faq.tsx b/packages/website/ts/pages/faq/faq.tsx index 8afb9e4e8..296e63f1d 100644 --- a/packages/website/ts/pages/faq/faq.tsx +++ b/packages/website/ts/pages/faq/faq.tsx @@ -411,7 +411,7 @@ const sections: FAQSection[] = [ prompt: 'How can I get involved?', answer: ( <div> - Join our <a href={constants.ZEROEX_CHAT_URL} target="_blank">Rocket.chat</a>! + Join our <a href={constants.URL_ZEROEX_CHAT} target="_blank">Rocket.chat</a>! As an open source project, 0x will rely on a worldwide community of passionate developers to contribute proposals, ideas and code. </div> diff --git a/packages/website/ts/pages/landing/landing.tsx b/packages/website/ts/pages/landing/landing.tsx index 87c8ca0b1..3d9ebe099 100644 --- a/packages/website/ts/pages/landing/landing.tsx +++ b/packages/website/ts/pages/landing/landing.tsx @@ -65,67 +65,67 @@ const boxContents: BoxContent[] = [ const projects: Project[] = [ { logoFileName: 'ethfinex-top.png', - projectUrl: constants.ETHFINEX_URL, + projectUrl: constants.PROJECT_URL_ETHFINEX, }, { logoFileName: 'radar_relay_top.png', - projectUrl: constants.RADAR_RELAY_URL, + projectUrl: constants.PROJECT_URL_RADAR_RELAY, }, { logoFileName: 'paradex_top.png', - projectUrl: constants.PARADEX_URL, + projectUrl: constants.PROJECT_URL_PARADEX, }, { logoFileName: 'the_ocean.png', - projectUrl: constants.OCEAN_URL, + projectUrl: constants.PROJECT_URL_0CEAN, }, { logoFileName: 'dydx.png', - projectUrl: constants.DYDX_URL, + projectUrl: constants.PROJECT_URL_DYDX, }, { logoFileName: 'melonport.png', - projectUrl: constants.MELONPORT_URL, + projectUrl: constants.PROJECT_URL_MELONPORT, }, { logoFileName: 'maker.png', - projectUrl: constants.MAKER_URL, + projectUrl: constants.PROJECT_URL_MAKER, }, { logoFileName: 'dharma.png', - projectUrl: constants.DHARMA_URL, + projectUrl: constants.PROJECT_URL_DHARMA, }, { logoFileName: 'lendroid.png', - projectUrl: constants.LENDROID_URL, + projectUrl: constants.PROJECT_URL_LENDROID, }, { logoFileName: 'district0x.png', - projectUrl: constants.DISTRICT_0X_URL, + projectUrl: constants.PROJECT_URL_DISTRICT_0X, }, { logoFileName: 'aragon.png', - projectUrl: constants.ARAGON_URL, + projectUrl: constants.PROJECT_URL_ARAGON, }, { logoFileName: 'blocknet.png', - projectUrl: constants.BLOCKNET_URL, + projectUrl: constants.PROJECT_URL_BLOCKNET, }, { logoFileName: 'status.png', - projectUrl: constants.STATUS_URL, + projectUrl: constants.PROJECT_URL_STATUS, }, { logoFileName: 'augur.png', - projectUrl: constants.AUGUR_URL, + projectUrl: constants.PROJECT_URL_AUGUR, }, { logoFileName: 'anx.png', - projectUrl: constants.OPEN_ANX_URL, + projectUrl: constants.PROJECT_URL_OPEN_ANX, }, { logoFileName: 'auctus.png', - projectUrl: constants.AUCTUS_URL, + projectUrl: constants.PROJECT_URL_AUCTUS, }, ]; @@ -236,7 +236,7 @@ export class Landing extends React.Component<LandingProps, LandingState> { </div> <div className="col col-6 sm-center"> <a - href={constants.ZEROEX_CHAT_URL} + href={constants.URL_ZEROEX_CHAT} target="_blank" className="text-decoration-none" > diff --git a/packages/website/ts/pages/wiki/wiki.tsx b/packages/website/ts/pages/wiki/wiki.tsx index 233df4f63..af5b26631 100644 --- a/packages/website/ts/pages/wiki/wiki.tsx +++ b/packages/website/ts/pages/wiki/wiki.tsx @@ -112,7 +112,7 @@ export class Wiki extends React.Component<WikiProps, WikiState> { > <div id="0xProtocolWiki" /> <h1 className="md-pl2 sm-pl3"> - <a href={constants.GITHUB_WIKI_URL} target="_blank"> + <a href={constants.URL_GITHUB_WIKI} target="_blank"> 0x Protocol Wiki </a> </h1> @@ -134,7 +134,7 @@ export class Wiki extends React.Component<WikiProps, WikiState> { private renderSection(sectionName: string) { const articles = this.state.articlesBySection[sectionName]; const renderedArticles = _.map(articles, (article: Article) => { - const githubLink = `${constants.GITHUB_WIKI_URL}/edit/master/${sectionName}/${article.fileName}`; + const githubLink = `${constants.URL_GITHUB_WIKI}/edit/master/${sectionName}/${article.fileName}`; return ( <div key={`markdown-section-${article.title}`}> <MarkdownSection |