aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-28 02:05:39 +0800
committerFabio Berger <me@fabioberger.com>2017-11-28 02:05:39 +0800
commit3e5abc60d31097346ffc3444a709aa870840a8ae (patch)
treeccd13e7ede162910026fc14b92f694fd637afd46 /packages
parentedf80aba1aeb59d3a12a6a979b4454143e84f445 (diff)
downloaddexon-0x-contracts-3e5abc60d31097346ffc3444a709aa870840a8ae.tar.gz
dexon-0x-contracts-3e5abc60d31097346ffc3444a709aa870840a8ae.tar.zst
dexon-0x-contracts-3e5abc60d31097346ffc3444a709aa870840a8ae.zip
Add "Web3" prefix to web3 alias types and link to the correct line in the web3 typings
Diffstat (limited to 'packages')
-rw-r--r--packages/website/ts/pages/documentation/type.tsx11
-rw-r--r--packages/website/ts/utils/constants.ts5
2 files changed, 14 insertions, 2 deletions
diff --git a/packages/website/ts/pages/documentation/type.tsx b/packages/website/ts/pages/documentation/type.tsx
index af18f97c2..7d02d6804 100644
--- a/packages/website/ts/pages/documentation/type.tsx
+++ b/packages/website/ts/pages/documentation/type.tsx
@@ -17,6 +17,14 @@ 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,
+};
+
+const typePrefix: {[typeName: string]: string} = {
+ Provider: 'Web3',
+ DecodedLogEntryEvent: 'Web3',
+ LogEntryEvent: 'Web3',
};
const typeToSection: {[typeName: string]: string} = {
@@ -119,6 +127,7 @@ export function Type(props: TypeProps): any {
});
const typeNameUrlIfExists = typeToUrl[(typeName as string)];
+ const typePrefixIfExists = typePrefix[(typeName as string)];
const sectionNameIfExists = typeToSection[(typeName as string)];
if (!_.isUndefined(typeNameUrlIfExists)) {
typeName = (
@@ -128,7 +137,7 @@ export function Type(props: TypeProps): any {
className="text-decoration-none"
style={{color: colors.lightBlueA700}}
>
- {typeName}
+ {!_.isUndefined(typePrefixIfExists) ? `${typePrefixIfExists}.` : ''}{typeName}
</a>
);
} else if ((isReference || isArray) &&
diff --git a/packages/website/ts/utils/constants.ts b/packages/website/ts/utils/constants.ts
index 42b80795e..7fc52b035 100644
--- a/packages/website/ts/utils/constants.ts
+++ b/packages/website/ts/utils/constants.ts
@@ -78,7 +78,10 @@ export const constants = {
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/ethereum/wiki/wiki/JavaScript-API#example-7',
+ 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',