aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers/contract_wrappers_documentation.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/website/ts/containers/contract_wrappers_documentation.ts')
-rw-r--r--packages/website/ts/containers/contract_wrappers_documentation.ts45
1 files changed, 10 insertions, 35 deletions
diff --git a/packages/website/ts/containers/contract_wrappers_documentation.ts b/packages/website/ts/containers/contract_wrappers_documentation.ts
index 4c05605e3..bbabce7a7 100644
--- a/packages/website/ts/containers/contract_wrappers_documentation.ts
+++ b/packages/website/ts/containers/contract_wrappers_documentation.ts
@@ -1,12 +1,10 @@
-import { DocsInfo, DocsInfoConfig, SupportedDocJson } from '@0x/react-docs';
+import { 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';
+import { DocPackages } from 'ts/types';
+
+import { getMapStateToProps, mapDispatchToProps } from '../utils/documentation_container';
/* tslint:disable:no-var-requires */
const IntroMarkdown1 = require('md/docs/contract_wrappers/1/introduction');
@@ -24,7 +22,7 @@ const docsInfoConfig: DocsInfoConfig = {
packageName: '@0x/contract-wrappers',
type: SupportedDocJson.TypeDoc,
displayName: 'Contract Wrappers',
- packageUrl: 'https://github.com/0xProject/0x-monorepo',
+ packageUrl: 'https://github.com/0xProject/0x-monorepo/packages/contract-wrappers',
markdownMenu: {
'getting-started': [markdownSections.introduction, markdownSections.installation],
},
@@ -40,32 +38,9 @@ const docsInfoConfig: DocsInfoConfig = {
},
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,
- docsInfo,
- translate: state.translate,
- screenWidth: state.screenWidth,
-});
-
-const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
- dispatcher: new Dispatcher(dispatch),
-});
+const mapStateToProps = getMapStateToProps(docsInfoConfig);
-export const Documentation: React.ComponentClass<DocPageProps> = connect(mapStateToProps, mapDispatchToProps)(
- DocPageComponent,
-);
+export const Documentation: React.ComponentClass<DocPageProps> = connect(
+ mapStateToProps,
+ mapDispatchToProps,
+)(DocPageComponent);