diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-08 19:23:33 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-08 21:48:06 +0800 |
commit | 2c974b5f3ffa0e9736000273e39cdeee4a251b94 (patch) | |
tree | a1772f93d796e3b4ba7a988194a44a3e8bcd6d31 /packages/website/ts/utils | |
parent | 0ac36cef288deecd36caa601c53d13517eef5ca8 (diff) | |
download | dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar.gz dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar.bz2 dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar.lz dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar.xz dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.tar.zst dexon-sol-tools-2c974b5f3ffa0e9736000273e39cdeee4a251b94.zip |
Refactor out sol-cov, sol-profiler and sol-trace into their separate packages
Diffstat (limited to 'packages/website/ts/utils')
-rw-r--r-- | packages/website/ts/utils/documentation_container.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/website/ts/utils/documentation_container.ts b/packages/website/ts/utils/documentation_container.ts new file mode 100644 index 000000000..54e8a2c1a --- /dev/null +++ b/packages/website/ts/utils/documentation_container.ts @@ -0,0 +1,35 @@ +import { DocsInfo, DocsInfoConfig } from '@0x/react-docs'; +import { Dispatch } from 'redux'; +import { DocPageProps } from 'ts/pages/documentation/doc_page'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { State } from 'ts/redux/reducer'; +import { ScreenWidths } from 'ts/types'; +import { Translate } from 'ts/utils/translate'; + +export interface ConnectedState { + docsVersion: string; + availableDocVersions: string[]; + docsInfo: DocsInfo; + translate: Translate; + screenWidth: ScreenWidths; +} + +export interface ConnectedDispatch { + dispatcher: Dispatcher; +} + +export const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({ + dispatcher: new Dispatcher(dispatch), +}); + +export const getMapStateToProps = (docsInfoConfig: DocsInfoConfig) => { + const docsInfo = new DocsInfo(docsInfoConfig); + const mapStateToProps = (state: State, _ownProps: DocPageProps): ConnectedState => ({ + docsVersion: state.docsVersion, + availableDocVersions: state.availableDocVersions, + translate: state.translate, + docsInfo, + screenWidth: state.screenWidth, + }); + return mapStateToProps; +}; |