diff options
author | Fabio Berger <me@fabioberger.com> | 2019-01-12 00:12:55 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2019-01-12 00:12:55 +0800 |
commit | 96ff5eef644b8c4d3f8fc4ec53270991fb51f121 (patch) | |
tree | 530f43b03d2b3aa09b5f6552d4285df92d45fed0 /packages/website/ts/containers/connect_documentation.ts | |
parent | 7f5a2c972bb86df77c423fb7029e9a629ecc1ede (diff) | |
parent | 2cf57a48dd2857dd5cf2f31f4c60dd47ae4d34a5 (diff) | |
download | dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar.gz dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar.bz2 dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar.lz dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar.xz dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.tar.zst dexon-sol-tools-96ff5eef644b8c4d3f8fc4ec53270991fb51f121.zip |
merge development
Diffstat (limited to 'packages/website/ts/containers/connect_documentation.ts')
-rw-r--r-- | packages/website/ts/containers/connect_documentation.ts | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/packages/website/ts/containers/connect_documentation.ts b/packages/website/ts/containers/connect_documentation.ts index 0f11e0809..1cfc0702e 100644 --- a/packages/website/ts/containers/connect_documentation.ts +++ b/packages/website/ts/containers/connect_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/connect/1/introduction'); @@ -25,7 +23,7 @@ const docsInfoConfig: DocsInfoConfig = { packageName: '@0x/connect', type: SupportedDocJson.TypeDoc, displayName: '0x Connect', - packageUrl: 'https://github.com/0xProject/0x-monorepo', + packageUrl: 'https://github.com/0xProject/0x-monorepo/packages/connect', markdownMenu: { 'getting-started': [markdownSections.introduction, markdownSections.installation], }, @@ -45,32 +43,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, - translate: state.translate, - docsInfo, - 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); |