aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-03 17:14:01 +0800
committerFabio Berger <me@fabioberger.com>2018-08-03 17:14:01 +0800
commit6dd656bdfc5e9878a8a6e332b4ea844556f75d56 (patch)
treec5fb6f39b4e32142047c667006a5beca5c147813 /packages/website/ts/containers
parentb5d98a280352d8f697876b35741fcf7b60b3b569 (diff)
downloaddexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar.gz
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar.bz2
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar.lz
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar.xz
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.tar.zst
dexon-sol-tools-6dd656bdfc5e9878a8a6e332b4ea844556f75d56.zip
Add OrderWatcher docs page
Diffstat (limited to 'packages/website/ts/containers')
-rw-r--r--packages/website/ts/containers/order_watcher_documentation.ts70
1 files changed, 70 insertions, 0 deletions
diff --git a/packages/website/ts/containers/order_watcher_documentation.ts b/packages/website/ts/containers/order_watcher_documentation.ts
new file mode 100644
index 000000000..29f1adf7c
--- /dev/null
+++ b/packages/website/ts/containers/order_watcher_documentation.ts
@@ -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,
+);