Add OrderWatcher docs page
This commit is contained in:
@@ -84,7 +84,9 @@ const DOC_WEBSITE_PATHS_TO_KEY = {
|
||||
[WebsitePaths.ContractWrappers]: Key.ContractWrappers,
|
||||
[WebsitePaths.Connect]: Key.Connect,
|
||||
[WebsitePaths.ZeroExJs]: Key.ZeroExJs,
|
||||
}
|
||||
[WebsitePaths.OrderUtils]: Key.OrderUtils,
|
||||
[WebsitePaths.OrderWatcher]: Key.OrderWatcher,
|
||||
};
|
||||
|
||||
const DEFAULT_HEIGHT = 68;
|
||||
const EXPANDED_HEIGHT = 75;
|
||||
@@ -166,12 +168,28 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
primaryText={this.props.translate.get(Key.Web3Wrapper, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-contractWrappers" to={WebsitePaths.ContractWrappers} className="text-decoration-none">
|
||||
<Link
|
||||
key="subMenuItem-contractWrappers"
|
||||
to={WebsitePaths.ContractWrappers}
|
||||
className="text-decoration-none"
|
||||
>
|
||||
<MenuItem
|
||||
style={{ fontSize: styles.menuItem.fontSize }}
|
||||
primaryText={this.props.translate.get(Key.ContractWrappers, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-orderUtils" to={WebsitePaths.OrderUtils} className="text-decoration-none">
|
||||
<MenuItem
|
||||
style={{ fontSize: styles.menuItem.fontSize }}
|
||||
primaryText={this.props.translate.get(Key.OrderUtils, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-orderWatcher" to={WebsitePaths.OrderWatcher} className="text-decoration-none">
|
||||
<MenuItem
|
||||
style={{ fontSize: styles.menuItem.fontSize }}
|
||||
primaryText={this.props.translate.get(Key.OrderWatcher, Deco.CapWords)}
|
||||
/>
|
||||
</Link>,
|
||||
<Link key="subMenuItem-sol-compiler" to={WebsitePaths.SolCompiler} className="text-decoration-none">
|
||||
<MenuItem
|
||||
style={{ fontSize: styles.menuItem.fontSize }}
|
||||
@@ -359,7 +377,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
{this.props.translate.get(key, Deco.Cap)}{' '}
|
||||
{this.props.translate.get(Key.Docs, Deco.Cap)}
|
||||
</MenuItem>
|
||||
</Link>
|
||||
</Link>;
|
||||
}
|
||||
})}
|
||||
{!this._isViewingPortal() && (
|
||||
@@ -391,10 +409,7 @@ export class TopBar extends React.Component<TopBarProps, TopBarState> {
|
||||
const isViewingDocsPage = _.some(DOC_WEBSITE_PATHS_TO_KEY, (_key, websitePath) => {
|
||||
return this._doesUrlInclude(websitePath);
|
||||
});
|
||||
if (
|
||||
!isViewingDocsPage ||
|
||||
_.isUndefined(this.props.menu)
|
||||
) {
|
||||
if (!isViewingDocsPage || _.isUndefined(this.props.menu)) {
|
||||
return undefined;
|
||||
}
|
||||
return (
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0xproject/react-docs';
|
||||
import * as React from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { Dispatch } from 'redux';
|
||||
import { DocPage as DocPageComponent, DocPageProps } from 'ts/pages/documentation/doc_page';
|
||||
import { Dispatcher } from 'ts/redux/dispatcher';
|
||||
import { State } from 'ts/redux/reducer';
|
||||
import { DocPackages } from 'ts/types';
|
||||
import { constants } from 'ts/utils/constants';
|
||||
import { Translate } from 'ts/utils/translate';
|
||||
|
||||
/* tslint:disable:no-var-requires */
|
||||
const IntroMarkdown = require('md/docs/order_watcher/introduction');
|
||||
const InstallationMarkdown = require('md/docs/order_watcher/installation');
|
||||
/* tslint:enable:no-var-requires */
|
||||
|
||||
const markdownSections = {
|
||||
introduction: 'introduction',
|
||||
installation: 'installation',
|
||||
};
|
||||
|
||||
const docsInfoConfig: DocsInfoConfig = {
|
||||
id: DocPackages.OrderWatcher,
|
||||
type: SupportedDocJson.TypeDoc,
|
||||
displayName: 'OrderWatcher',
|
||||
packageUrl: 'https://github.com/0xProject/0x-monorepo',
|
||||
markdownMenu: {
|
||||
introduction: [markdownSections.introduction],
|
||||
install: [markdownSections.installation],
|
||||
},
|
||||
sectionNameToMarkdownByVersion: {
|
||||
'0.0.1': {
|
||||
[markdownSections.introduction]: IntroMarkdown,
|
||||
[markdownSections.installation]: InstallationMarkdown,
|
||||
},
|
||||
},
|
||||
markdownSections,
|
||||
typeConfigs: {
|
||||
typeNameToExternalLink: {
|
||||
BigNumber: constants.URL_BIGNUMBERJS_GITHUB,
|
||||
},
|
||||
},
|
||||
};
|
||||
const docsInfo = new DocsInfo(docsInfoConfig);
|
||||
|
||||
interface ConnectedState {
|
||||
docsVersion: string;
|
||||
availableDocVersions: string[];
|
||||
docsInfo: DocsInfo;
|
||||
translate: Translate;
|
||||
}
|
||||
|
||||
interface ConnectedDispatch {
|
||||
dispatcher: Dispatcher;
|
||||
}
|
||||
|
||||
const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
|
||||
docsVersion: state.docsVersion,
|
||||
availableDocVersions: state.availableDocVersions,
|
||||
translate: state.translate,
|
||||
docsInfo,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
|
||||
dispatcher: new Dispatcher(dispatch),
|
||||
});
|
||||
|
||||
export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
|
||||
DocPageComponent,
|
||||
);
|
||||
@@ -40,6 +40,9 @@ const LazyZeroExJSDocumentation = createLazyComponent('Documentation', async ()
|
||||
const LazyContractWrappersDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "contractWrapperDocs" */ 'ts/containers/contract_wrappers_documentation'),
|
||||
);
|
||||
const LazyOrderWatcherDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "orderWatcherDocs" */ 'ts/containers/order_watcher_documentation'),
|
||||
);
|
||||
const LazySmartContractsDocumentation = createLazyComponent('Documentation', async () =>
|
||||
System.import<any>(/* webpackChunkName: "smartContractDocs" */ 'ts/containers/smart_contracts_documentation'),
|
||||
);
|
||||
@@ -83,7 +86,14 @@ render(
|
||||
<Route path={WebsitePaths.About} component={About as any} />
|
||||
<Route path={WebsitePaths.Wiki} component={Wiki as any} />
|
||||
<Route path={`${WebsitePaths.ZeroExJs}/:version?`} component={LazyZeroExJSDocumentation} />
|
||||
<Route path={`${WebsitePaths.ContractWrappers}/:version?`} component={LazyContractWrappersDocumentation} />
|
||||
<Route
|
||||
path={`${WebsitePaths.ContractWrappers}/:version?`}
|
||||
component={LazyContractWrappersDocumentation}
|
||||
/>
|
||||
<Route
|
||||
path={`${WebsitePaths.OrderWatcher}/:version?`}
|
||||
component={LazyOrderWatcherDocumentation}
|
||||
/>
|
||||
<Route path={`${WebsitePaths.Connect}/:version?`} component={LazyConnectDocumentation} />
|
||||
<Route
|
||||
path={`${WebsitePaths.SolCompiler}/:version?`}
|
||||
|
||||
@@ -34,6 +34,7 @@ const docIdToSubpackageName: { [id: string]: string } = {
|
||||
[DocPackages.SolCov]: 'sol-cov',
|
||||
[DocPackages.Subproviders]: 'subproviders',
|
||||
[DocPackages.OrderUtils]: 'order-utils',
|
||||
[DocPackages.OrderWatcher]: 'order-watcher',
|
||||
[DocPackages.EthereumTypes]: 'ethereum-types',
|
||||
};
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ export class Landing extends React.Component<LandingProps, LandingState> {
|
||||
style={{ fontFamily: 'Roboto Mono' }}
|
||||
>
|
||||
<div>{this.props.translate.get(Key.OffChainOrderRelay, Deco.Cap)}</div>
|
||||
<div> {this.props.translate.get(Key.OonChainSettlement, Deco.Cap)}</div>
|
||||
<div> {this.props.translate.get(Key.OnChainSettlement, Deco.Cap)}</div>
|
||||
</div>
|
||||
<div
|
||||
className="pb2 pt2 h5 sm-center sm-px3 sm-mx-auto"
|
||||
|
||||
@@ -372,6 +372,7 @@ export enum WebsitePaths {
|
||||
Connect = '/docs/connect',
|
||||
Web3Wrapper = '/docs/web3-wrapper',
|
||||
ContractWrappers = '/docs/contract-wrappers',
|
||||
OrderWatcher = '/docs/order-watcher',
|
||||
SolCompiler = '/docs/sol-compiler',
|
||||
JSONSchemas = '/docs/json-schemas',
|
||||
SolCov = '/docs/sol-cov',
|
||||
@@ -393,6 +394,7 @@ export enum DocPackages {
|
||||
OrderUtils = 'ORDER_UTILS',
|
||||
EthereumTypes = 'ETHEREUM_TYPES',
|
||||
ContractWrappers = 'CONTRACT_WRAPPERS',
|
||||
OrderWatcher = 'ORDER_WATCHER',
|
||||
}
|
||||
|
||||
export enum Key {
|
||||
@@ -409,7 +411,7 @@ export enum Key {
|
||||
TraditionalAssets = 'TRADITIONAL_ASSETS',
|
||||
DigitalGoods = 'DIGITAL_GOODS',
|
||||
OffChainOrderRelay = 'OFFCHAIN_ORDER_RELAY',
|
||||
OonChainSettlement = 'OONCHAIN_SETTLEMENT',
|
||||
OnChainSettlement = 'ONCHAIN_SETTLEMENT',
|
||||
OffChainOnChainDescription = 'OFFCHAIN_ONCHAIN_DESCRIPTION',
|
||||
RelayersHeader = 'RELAYERS_HEADER',
|
||||
BenefitsHeader = 'BENEFITS_HEADER',
|
||||
@@ -448,6 +450,7 @@ export enum Key {
|
||||
Subproviders = 'SUBPROVIDERS',
|
||||
ZeroExJs = '0X_JS',
|
||||
ContractWrappers = 'CONTRACT_WRAPPERS',
|
||||
OrderWatcher = 'ORDER_WATCHER',
|
||||
Blog = 'BLOG',
|
||||
Forum = 'FORUM',
|
||||
Connect = 'CONNECT',
|
||||
|
||||
Reference in New Issue
Block a user