2017-09-25 02:06:28 +00:00
|
|
|
import {
|
|
|
|
changeGasPrice as dChangeGasPrice,
|
|
|
|
changeLanguage as dChangeLanguage,
|
2017-10-04 04:37:06 +00:00
|
|
|
changeNodeIntent as dChangeNodeIntent,
|
2017-11-18 20:33:53 +00:00
|
|
|
addCustomNode as dAddCustomNode,
|
|
|
|
removeCustomNode as dRemoveCustomNode,
|
2017-09-25 02:06:28 +00:00
|
|
|
TChangeGasPrice,
|
|
|
|
TChangeLanguage,
|
2017-11-18 20:33:53 +00:00
|
|
|
TChangeNodeIntent,
|
|
|
|
TAddCustomNode,
|
|
|
|
TRemoveCustomNode,
|
2017-09-25 02:06:28 +00:00
|
|
|
} from 'actions/config';
|
|
|
|
import { AlphaAgreement, Footer, Header } from 'components';
|
2017-05-23 23:06:01 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
2017-09-25 02:06:28 +00:00
|
|
|
import { AppState } from 'reducers';
|
2017-06-21 23:31:59 +00:00
|
|
|
import Notifications from './Notifications';
|
2017-11-18 20:33:53 +00:00
|
|
|
import { NodeConfig, CustomNodeConfig } from 'config/data';
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
interface Props {
|
|
|
|
// FIXME
|
|
|
|
children: any;
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
languageSelection: string;
|
2017-11-18 20:33:53 +00:00
|
|
|
node: NodeConfig;
|
2017-09-25 02:06:28 +00:00
|
|
|
nodeSelection: string;
|
2017-11-18 20:33:53 +00:00
|
|
|
isChangingNode: boolean;
|
2017-09-25 02:06:28 +00:00
|
|
|
gasPriceGwei: number;
|
2017-11-18 20:33:53 +00:00
|
|
|
customNodes: CustomNodeConfig[];
|
|
|
|
latestBlock: string;
|
2017-04-14 06:22:53 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
changeLanguage: TChangeLanguage;
|
2017-10-04 04:37:06 +00:00
|
|
|
changeNodeIntent: TChangeNodeIntent;
|
2017-09-25 02:06:28 +00:00
|
|
|
changeGasPrice: TChangeGasPrice;
|
2017-11-18 20:33:53 +00:00
|
|
|
addCustomNode: TAddCustomNode;
|
|
|
|
removeCustomNode: TRemoveCustomNode;
|
2017-09-25 02:06:28 +00:00
|
|
|
}
|
2017-10-04 04:13:49 +00:00
|
|
|
class TabSection extends Component<Props, {}> {
|
2017-09-25 02:06:28 +00:00
|
|
|
public render() {
|
|
|
|
const {
|
2017-07-04 03:21:19 +00:00
|
|
|
children,
|
|
|
|
// APP
|
2017-11-18 20:33:53 +00:00
|
|
|
node,
|
2017-07-20 17:06:10 +00:00
|
|
|
nodeSelection,
|
2017-11-18 20:33:53 +00:00
|
|
|
isChangingNode,
|
2017-07-04 03:21:19 +00:00
|
|
|
languageSelection,
|
2017-07-20 17:06:10 +00:00
|
|
|
gasPriceGwei,
|
2017-11-18 20:33:53 +00:00
|
|
|
customNodes,
|
|
|
|
latestBlock,
|
2017-07-20 17:06:10 +00:00
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
changeLanguage,
|
2017-10-04 04:37:06 +00:00
|
|
|
changeNodeIntent,
|
2017-11-18 20:33:53 +00:00
|
|
|
changeGasPrice,
|
|
|
|
addCustomNode,
|
|
|
|
removeCustomNode,
|
2017-07-04 03:21:19 +00:00
|
|
|
} = this.props;
|
2017-06-21 23:31:59 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
const headerProps = {
|
2017-07-04 03:21:19 +00:00
|
|
|
languageSelection,
|
2017-11-18 20:33:53 +00:00
|
|
|
node,
|
2017-07-20 17:06:10 +00:00
|
|
|
nodeSelection,
|
2017-11-18 20:33:53 +00:00
|
|
|
isChangingNode,
|
2017-07-20 17:06:10 +00:00
|
|
|
gasPriceGwei,
|
2017-11-18 20:33:53 +00:00
|
|
|
customNodes,
|
2017-07-20 17:06:10 +00:00
|
|
|
|
|
|
|
changeLanguage,
|
2017-10-04 04:37:06 +00:00
|
|
|
changeNodeIntent,
|
2017-11-18 20:33:53 +00:00
|
|
|
changeGasPrice,
|
|
|
|
addCustomNode,
|
|
|
|
removeCustomNode,
|
2017-05-23 23:06:01 +00:00
|
|
|
};
|
2017-04-12 05:04:27 +00:00
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
return (
|
|
|
|
<div className="page-layout">
|
|
|
|
<main>
|
|
|
|
<Header {...headerProps} />
|
2017-09-29 02:09:01 +00:00
|
|
|
<div className="Tab container">{children}</div>
|
2017-11-18 20:33:53 +00:00
|
|
|
<Footer latestBlock={latestBlock} />
|
2017-07-04 03:21:19 +00:00
|
|
|
</main>
|
|
|
|
<Notifications />
|
2017-08-28 19:09:42 +00:00
|
|
|
<AlphaAgreement />
|
2017-07-04 03:21:19 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
function mapStateToProps(state: AppState) {
|
2017-07-04 03:21:19 +00:00
|
|
|
return {
|
2017-11-18 20:33:53 +00:00
|
|
|
node: state.config.node,
|
2017-07-04 03:21:19 +00:00
|
|
|
nodeSelection: state.config.nodeSelection,
|
2017-11-18 20:33:53 +00:00
|
|
|
isChangingNode: state.config.isChangingNode,
|
2017-07-04 03:21:19 +00:00
|
|
|
languageSelection: state.config.languageSelection,
|
2017-11-18 20:33:53 +00:00
|
|
|
gasPriceGwei: state.config.gasPriceGwei,
|
|
|
|
customNodes: state.config.customNodes,
|
|
|
|
latestBlock: state.config.latestBlock,
|
2017-07-04 03:21:19 +00:00
|
|
|
};
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
export default connect(mapStateToProps, {
|
|
|
|
changeGasPrice: dChangeGasPrice,
|
|
|
|
changeLanguage: dChangeLanguage,
|
2017-11-18 20:33:53 +00:00
|
|
|
changeNodeIntent: dChangeNodeIntent,
|
|
|
|
addCustomNode: dAddCustomNode,
|
|
|
|
removeCustomNode: dRemoveCustomNode,
|
2017-10-04 04:13:49 +00:00
|
|
|
})(TabSection);
|