aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 06:14:27 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-22 06:14:27 +0800
commit0adc8f5053894de7df85aacb6a8bf8714f989f0a (patch)
tree24ddf4531ef472739b276711a4b85e9a3017b156 /packages/website/ts/containers
parenteca63b1a5815c61901453837f9c2b737fa82eb20 (diff)
parentf46a49fd13c88dd86c9661d76bace18844642c04 (diff)
downloaddexon-0x-contracts-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.gz
dexon-0x-contracts-0adc8f5053894de7df85aacb6a8bf8714f989f0a.tar.zst
dexon-0x-contracts-0adc8f5053894de7df85aacb6a8bf8714f989f0a.zip
Merge branch 'development' into feature/header-tweaks
Diffstat (limited to 'packages/website/ts/containers')
-rw-r--r--packages/website/ts/containers/migrations_documentation.ts66
1 files changed, 66 insertions, 0 deletions
diff --git a/packages/website/ts/containers/migrations_documentation.ts b/packages/website/ts/containers/migrations_documentation.ts
new file mode 100644
index 000000000..02919e06e
--- /dev/null
+++ b/packages/website/ts/containers/migrations_documentation.ts
@@ -0,0 +1,66 @@
+import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/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, ScreenWidths } from 'ts/types';
+import { Translate } from 'ts/utils/translate';
+
+/* tslint:disable:no-var-requires */
+const IntroMarkdown1 = require('md/docs/migrations/1/introduction');
+const InstallationMarkdown1 = require('md/docs/migrations/1/installation');
+/* tslint:enable:no-var-requires */
+
+const markdownSections = {
+ introduction: 'introduction',
+ installation: 'installation',
+};
+
+const docsInfoConfig: DocsInfoConfig = {
+ id: DocPackages.Migrations,
+ packageName: '@0x/migrations',
+ type: SupportedDocJson.TypeDoc,
+ displayName: 'Migrations',
+ packageUrl: 'https://github.com/0xProject/0x-monorepo',
+ markdownMenu: {
+ 'getting-started': [markdownSections.introduction, markdownSections.installation],
+ },
+ sectionNameToMarkdownByVersion: {
+ '2.0.4': {
+ [markdownSections.introduction]: IntroMarkdown1,
+ [markdownSections.installation]: InstallationMarkdown1,
+ },
+ },
+ markdownSections,
+};
+const docsInfo = new DocsInfo(docsInfoConfig);
+
+interface ConnectedState {
+ docsVersion: string;
+ availableDocVersions: string[];
+ docsInfo: DocsInfo;
+ translate: Translate;
+ screenWidth: ScreenWidths;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({
+ docsVersion: state.docsVersion,
+ availableDocVersions: state.availableDocVersions,
+ translate: state.translate,
+ docsInfo,
+ screenWidth: state.screenWidth,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
+ DocPageComponent,
+);