aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/containers
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-02-22 03:46:16 +0800
committerFabio Berger <me@fabioberger.com>2018-02-22 03:46:16 +0800
commite2d17d122e25feeabb1d5499065274ec6e30bd4f (patch)
tree3b6db4ea36eea523b09e8aa0199111b0c98eedb1 /packages/website/ts/containers
parent0d7bf505810602e73b168bde6887f76e315c50ae (diff)
downloaddexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar.gz
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar.bz2
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar.lz
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar.xz
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.tar.zst
dexon-sol-tools-e2d17d122e25feeabb1d5499065274ec6e30bd4f.zip
Keep topBar and footer language to the one picked by the user
Diffstat (limited to 'packages/website/ts/containers')
-rw-r--r--packages/website/ts/containers/about.tsx26
-rw-r--r--packages/website/ts/containers/connect_documentation.tsx3
-rw-r--r--packages/website/ts/containers/faq.tsx26
-rw-r--r--packages/website/ts/containers/not_found.tsx28
-rw-r--r--packages/website/ts/containers/portal.tsx3
-rw-r--r--packages/website/ts/containers/smart_contracts_documentation.tsx3
-rw-r--r--packages/website/ts/containers/wiki.tsx26
-rw-r--r--packages/website/ts/containers/zero_ex_js_documentation.tsx3
8 files changed, 118 insertions, 0 deletions
diff --git a/packages/website/ts/containers/about.tsx b/packages/website/ts/containers/about.tsx
new file mode 100644
index 000000000..ce8fd3afb
--- /dev/null
+++ b/packages/website/ts/containers/about.tsx
@@ -0,0 +1,26 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { About as AboutComponent, AboutProps } from 'ts/pages/about/about';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { Translate } from 'ts/utils/translate';
+
+interface ConnectedState {
+ translate: Translate;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, ownProps: AboutProps): ConnectedState => ({
+ translate: state.translate,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+export const About: React.ComponentClass<AboutProps> = connect(mapStateToProps, mapDispatchToProps)(AboutComponent);
diff --git a/packages/website/ts/containers/connect_documentation.tsx b/packages/website/ts/containers/connect_documentation.tsx
index fd3029970..2488329dd 100644
--- a/packages/website/ts/containers/connect_documentation.tsx
+++ b/packages/website/ts/containers/connect_documentation.tsx
@@ -9,6 +9,7 @@ import { State } from 'ts/redux/reducer';
import { DocsInfoConfig, Environments, WebsitePaths } from 'ts/types';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
import { typeDocUtils } from 'ts/utils/typedoc_utils';
/* tslint:disable:no-var-requires */
@@ -83,6 +84,7 @@ interface ConnectedState {
docsVersion: string;
availableDocVersions: string[];
docsInfo: DocsInfo;
+ translate: Translate;
}
interface ConnectedDispatch {
@@ -92,6 +94,7 @@ interface ConnectedDispatch {
const mapStateToProps = (state: State, ownProps: DocumentationAllProps): ConnectedState => ({
docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions,
+ translate: state.translate,
docsInfo,
});
diff --git a/packages/website/ts/containers/faq.tsx b/packages/website/ts/containers/faq.tsx
new file mode 100644
index 000000000..b539e33c9
--- /dev/null
+++ b/packages/website/ts/containers/faq.tsx
@@ -0,0 +1,26 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { FAQ as FAQComponent, FAQProps } from 'ts/pages/faq/faq';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { Translate } from 'ts/utils/translate';
+
+interface ConnectedState {
+ translate: Translate;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, ownProps: FAQProps): ConnectedState => ({
+ translate: state.translate,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+export const FAQ: React.ComponentClass<FAQProps> = connect(mapStateToProps, mapDispatchToProps)(FAQComponent);
diff --git a/packages/website/ts/containers/not_found.tsx b/packages/website/ts/containers/not_found.tsx
new file mode 100644
index 000000000..dd151e2c8
--- /dev/null
+++ b/packages/website/ts/containers/not_found.tsx
@@ -0,0 +1,28 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { NotFound as NotFoundComponent, NotFoundProps } from 'ts/pages/not_found';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { Translate } from 'ts/utils/translate';
+
+interface ConnectedState {
+ translate: Translate;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, ownProps: NotFoundProps): ConnectedState => ({
+ translate: state.translate,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+export const NotFound: React.ComponentClass<NotFoundProps> = connect(mapStateToProps, mapDispatchToProps)(
+ NotFoundComponent,
+);
diff --git a/packages/website/ts/containers/portal.tsx b/packages/website/ts/containers/portal.tsx
index bcca0d70f..befa16bdb 100644
--- a/packages/website/ts/containers/portal.tsx
+++ b/packages/website/ts/containers/portal.tsx
@@ -8,6 +8,7 @@ import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
import { BlockchainErrs, HashData, Order, ProviderType, ScreenWidths, Side, TokenByAddress } from 'ts/types';
import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
interface ConnectedState {
blockchainErr: BlockchainErrs;
@@ -26,6 +27,7 @@ interface ConnectedState {
userAddress: string;
userSuppliedOrderCache: Order;
flashMessage?: string | React.ReactNode;
+ translate: Translate;
}
interface ConnectedDispatch {
@@ -73,6 +75,7 @@ const mapStateToProps = (state: State, ownProps: PortalComponentAllProps): Conne
userEtherBalance: state.userEtherBalance,
userSuppliedOrderCache: state.userSuppliedOrderCache,
flashMessage: state.flashMessage,
+ translate: state.translate,
};
};
diff --git a/packages/website/ts/containers/smart_contracts_documentation.tsx b/packages/website/ts/containers/smart_contracts_documentation.tsx
index 8be33b546..c4731f929 100644
--- a/packages/website/ts/containers/smart_contracts_documentation.tsx
+++ b/packages/website/ts/containers/smart_contracts_documentation.tsx
@@ -8,6 +8,7 @@ import { Dispatcher } from 'ts/redux/dispatcher';
import { State } from 'ts/redux/reducer';
import { DocsInfoConfig, SmartContractDocSections as Sections, WebsitePaths } from 'ts/types';
import { doxityUtils } from 'ts/utils/doxity_utils';
+import { Translate } from 'ts/utils/translate';
/* tslint:disable:no-var-requires */
const IntroMarkdown = require('md/docs/smart_contracts/introduction');
@@ -40,6 +41,7 @@ const docsInfo = new DocsInfo(docsInfoConfig);
interface ConnectedState {
docsVersion: string;
availableDocVersions: string[];
+ translate: Translate;
}
interface ConnectedDispatch {
@@ -50,6 +52,7 @@ interface ConnectedDispatch {
const mapStateToProps = (state: State, ownProps: DocumentationAllProps): ConnectedState => ({
docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions,
+ translate: state.translate,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
diff --git a/packages/website/ts/containers/wiki.tsx b/packages/website/ts/containers/wiki.tsx
new file mode 100644
index 000000000..2cb87d0a1
--- /dev/null
+++ b/packages/website/ts/containers/wiki.tsx
@@ -0,0 +1,26 @@
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { Dispatch } from 'redux';
+import { Wiki as WikiComponent, WikiProps } from 'ts/pages/wiki/wiki';
+import { Dispatcher } from 'ts/redux/dispatcher';
+import { State } from 'ts/redux/reducer';
+import { Translate } from 'ts/utils/translate';
+
+interface ConnectedState {
+ translate: Translate;
+}
+
+interface ConnectedDispatch {
+ dispatcher: Dispatcher;
+}
+
+const mapStateToProps = (state: State, ownProps: WikiProps): ConnectedState => ({
+ translate: state.translate,
+});
+
+const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({
+ dispatcher: new Dispatcher(dispatch),
+});
+
+export const Wiki: React.ComponentClass<WikiProps> = connect(mapStateToProps, mapDispatchToProps)(WikiComponent);
diff --git a/packages/website/ts/containers/zero_ex_js_documentation.tsx b/packages/website/ts/containers/zero_ex_js_documentation.tsx
index eee2c7cc8..a32a87f7f 100644
--- a/packages/website/ts/containers/zero_ex_js_documentation.tsx
+++ b/packages/website/ts/containers/zero_ex_js_documentation.tsx
@@ -9,6 +9,7 @@ import { State } from 'ts/redux/reducer';
import { DocsInfoConfig, Environments, WebsitePaths } from 'ts/types';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
import { typeDocUtils } from 'ts/utils/typedoc_utils';
/* tslint:disable:no-var-requires */
@@ -154,6 +155,7 @@ interface ConnectedState {
docsVersion: string;
availableDocVersions: string[];
docsInfo: DocsInfo;
+ translate: Translate;
}
interface ConnectedDispatch {
@@ -164,6 +166,7 @@ const mapStateToProps = (state: State, ownProps: DocumentationAllProps): Connect
docsVersion: state.docsVersion,
availableDocVersions: state.availableDocVersions,
docsInfo,
+ translate: state.translate,
});
const mapDispatchToProps = (dispatch: Dispatch<State>): ConnectedDispatch => ({