aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components
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/components
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/components')
-rw-r--r--packages/website/ts/components/footer.tsx7
-rw-r--r--packages/website/ts/components/portal.tsx4
2 files changed, 6 insertions, 5 deletions
diff --git a/packages/website/ts/components/footer.tsx b/packages/website/ts/components/footer.tsx
index 896b36931..2d03ca576 100644
--- a/packages/website/ts/components/footer.tsx
+++ b/packages/website/ts/components/footer.tsx
@@ -3,6 +3,7 @@ import DropDownMenu from 'material-ui/DropDownMenu';
import MenuItem from 'material-ui/MenuItem';
import * as React from 'react';
import { Link } from 'react-router-dom';
+import { Dispatcher } from 'ts/redux/dispatcher';
import { Deco, Key, Language, WebsitePaths } from 'ts/types';
import { colors } from 'ts/utils/colors';
import { constants } from 'ts/utils/constants';
@@ -35,7 +36,7 @@ const languageToMenuTitle = {
export interface FooterProps {
translate?: Translate;
- onLanguageSelected?: (language: Language) => void;
+ dispatcher: Dispatcher;
}
interface FooterState {
@@ -243,8 +244,6 @@ export class Footer extends React.Component<FooterProps, FooterState> {
this.setState({
selectedLanguage: value,
});
- if (!_.isUndefined(this.props.onLanguageSelected)) {
- this.props.onLanguageSelected(value);
- }
+ this.props.dispatcher.updateSelectedLanguage(value);
}
}
diff --git a/packages/website/ts/components/portal.tsx b/packages/website/ts/components/portal.tsx
index 0409f28c0..71f756a89 100644
--- a/packages/website/ts/components/portal.tsx
+++ b/packages/website/ts/components/portal.tsx
@@ -27,6 +27,7 @@ import { BlockchainErrs, HashData, Order, ProviderType, ScreenWidths, TokenByAdd
import { colors } from 'ts/utils/colors';
import { configs } from 'ts/utils/configs';
import { constants } from 'ts/utils/constants';
+import { Translate } from 'ts/utils/translate';
import { utils } from 'ts/utils/utils';
const THROTTLE_TIMEOUT = 100;
@@ -52,6 +53,7 @@ export interface PortalAllProps {
location: Location;
flashMessage?: string | React.ReactNode;
lastForceTokenStateRefetch: number;
+ translate: Translate;
}
interface PortalAllState {
@@ -259,7 +261,7 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
/>
)}
</div>
- <Footer />;
+ <Footer translate={this.props.translate} dispatcher={this.props.dispatcher} />
</div>
);
}