aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-11-28 04:44:32 +0800
committerGitHub <noreply@github.com>2017-11-28 04:44:32 +0800
commit694c37150c35f8d9810067b8810764585ac76508 (patch)
treec465be06e2d23630c05c8554806ec1de76a8fb10 /packages
parent48b3d8526560d389e74beb12bbd64b7be6e9268f (diff)
parente7b523074ab124f2d4e790d71aac9df7e1e2c4cf (diff)
downloaddexon-0x-contracts-694c37150c35f8d9810067b8810764585ac76508.tar.gz
dexon-0x-contracts-694c37150c35f8d9810067b8810764585ac76508.tar.zst
dexon-0x-contracts-694c37150c35f8d9810067b8810764585ac76508.zip
Merge pull request #239 from 0xProject/fix/docs
Fix 0x.js Doc Issues
Diffstat (limited to 'packages')
-rw-r--r--packages/0x.js/src/types.ts3
-rw-r--r--packages/website/ts/pages/documentation/method_block.tsx3
-rw-r--r--packages/website/ts/pages/documentation/source_link.tsx8
-rw-r--r--packages/website/ts/pages/documentation/type.tsx11
-rw-r--r--packages/website/ts/utils/constants.ts5
5 files changed, 22 insertions, 8 deletions
diff --git a/packages/0x.js/src/types.ts b/packages/0x.js/src/types.ts
index 143e2b6b2..4d55046b4 100644
--- a/packages/0x.js/src/types.ts
+++ b/packages/0x.js/src/types.ts
@@ -383,7 +383,8 @@ export type AsyncMethod = (...args: any[]) => Promise<any>;
/**
* We re-export the `Web3.Provider` type specified in the Web3 Typescript typings
* since it is the type of the `provider` argument to the `ZeroEx` constructor.
- * It is however a `Web3` library type, not a native `0x.js` type.
+ * It is however a `Web3` library type, not a native `0x.js` type. To learn more
+ * about providers, visit https://0xproject.com/wiki#Web3-Provider-Explained
*/
export type Web3Provider = Web3.Provider;
diff --git a/packages/website/ts/pages/documentation/method_block.tsx b/packages/website/ts/pages/documentation/method_block.tsx
index 6fead2f47..e31c75ffd 100644
--- a/packages/website/ts/pages/documentation/method_block.tsx
+++ b/packages/website/ts/pages/documentation/method_block.tsx
@@ -145,8 +145,7 @@ export class MethodBlock extends React.Component<MethodBlockProps, MethodBlockSt
className="flex pb1 mb2"
style={{borderBottom: '1px solid #f0f4f7'}}
>
- <div className="col lg-col-1 md-col-1 sm-hide xs-hide" />
- <div className="col lg-col-3 md-col-3 sm-col-12 col-12">
+ <div className="pl2 col lg-col-4 md-col-4 sm-col-12 col-12">
<div className="bold">
{parameter.name}
</div>
diff --git a/packages/website/ts/pages/documentation/source_link.tsx b/packages/website/ts/pages/documentation/source_link.tsx
index 2fb69e2f0..24009ce8a 100644
--- a/packages/website/ts/pages/documentation/source_link.tsx
+++ b/packages/website/ts/pages/documentation/source_link.tsx
@@ -8,10 +8,12 @@ interface SourceLinkProps {
version: string;
}
+const SUB_PKG = '0x.js';
+
export function SourceLink(props: SourceLinkProps) {
- const source = props.source;
- const githubUrl = constants.GITHUB_0X_JS_URL;
- const sourceCodeUrl = `${githubUrl}/blob/v${props.version}/${source.fileName}#L${source.line}`;
+ const src = props.source;
+ const url = constants.GITHUB_0X_JS_URL;
+ const sourceCodeUrl = `${url}/blob/${SUB_PKG}%40${props.version}/packages/${SUB_PKG}/${src.fileName}#L${src.line}`;
return (
<div className="pt2" style={{fontSize: 14}}>
<a
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',