2017-09-25 02:06:28 +00:00
|
|
|
import {
|
|
|
|
changeGasPrice as dChangeGasPrice,
|
|
|
|
changeLanguage as dChangeLanguage,
|
|
|
|
changeNode as dChangeNode,
|
|
|
|
TChangeGasPrice,
|
|
|
|
TChangeLanguage,
|
|
|
|
TChangeNode
|
|
|
|
} 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-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;
|
|
|
|
nodeSelection: string;
|
2017-04-25 00:03:41 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
gasPriceGwei: number;
|
2017-04-14 06:22:53 +00:00
|
|
|
|
2017-09-25 02:06:28 +00:00
|
|
|
changeLanguage: TChangeLanguage;
|
|
|
|
changeNode: TChangeNode;
|
|
|
|
changeGasPrice: TChangeGasPrice;
|
|
|
|
}
|
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-07-20 17:06:10 +00:00
|
|
|
nodeSelection,
|
2017-07-04 03:21:19 +00:00
|
|
|
languageSelection,
|
2017-07-20 17:06:10 +00:00
|
|
|
gasPriceGwei,
|
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
changeLanguage,
|
|
|
|
changeNode,
|
2017-07-20 17:06:10 +00:00
|
|
|
changeGasPrice
|
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-07-20 17:06:10 +00:00
|
|
|
nodeSelection,
|
|
|
|
gasPriceGwei,
|
|
|
|
|
|
|
|
changeLanguage,
|
2017-07-04 03:21:19 +00:00
|
|
|
changeNode,
|
2017-07-20 17:06:10 +00:00
|
|
|
changeGasPrice
|
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-07-04 03:21:19 +00:00
|
|
|
<Footer />
|
|
|
|
</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 {
|
|
|
|
nodeSelection: state.config.nodeSelection,
|
|
|
|
languageSelection: state.config.languageSelection,
|
2017-07-20 17:06:10 +00:00
|
|
|
gasPriceGwei: state.config.gasPriceGwei
|
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,
|
|
|
|
changeNode: dChangeNode
|
2017-10-04 04:13:49 +00:00
|
|
|
})(TabSection);
|