2017-05-24 22:39:58 +00:00
|
|
|
// @flow
|
2017-05-23 23:06:01 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
2017-08-28 19:09:42 +00:00
|
|
|
import { Footer, Header, AlphaAgreement } from 'components';
|
2017-06-21 23:31:59 +00:00
|
|
|
import Notifications from './Notifications';
|
2017-07-04 01:25:01 +00:00
|
|
|
import * as actions from 'actions/config';
|
2017-04-12 05:04:27 +00:00
|
|
|
|
|
|
|
class App extends Component {
|
2017-07-04 03:21:19 +00:00
|
|
|
props: {
|
|
|
|
// FIXME
|
|
|
|
children: any,
|
|
|
|
location: any,
|
|
|
|
router: any,
|
|
|
|
isMobile: boolean,
|
2017-04-25 00:03:41 +00:00
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
languageSelection: string,
|
|
|
|
nodeSelection: string,
|
2017-04-14 06:22:53 +00:00
|
|
|
|
2017-07-20 17:06:10 +00:00
|
|
|
gasPriceGwei: number,
|
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
changeLanguage: typeof actions.changeLanguage,
|
|
|
|
changeNode: typeof actions.changeNode,
|
2017-07-20 17:06:10 +00:00
|
|
|
changeGasPrice: typeof actions.changeGasPrice,
|
2017-07-04 03:21:19 +00:00
|
|
|
handleWindowResize: () => void
|
|
|
|
};
|
2017-04-14 06:22:53 +00:00
|
|
|
|
2017-07-04 03:21:19 +00:00
|
|
|
render() {
|
|
|
|
let {
|
|
|
|
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-07-04 03:21:19 +00:00
|
|
|
let headerProps = {
|
|
|
|
location,
|
|
|
|
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} />
|
|
|
|
<div className="main-content">
|
|
|
|
{React.cloneElement(children, { languageSelection })}
|
|
|
|
</div>
|
|
|
|
<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
|
|
|
}
|
|
|
|
|
|
|
|
function mapStateToProps(state) {
|
2017-07-04 03:21:19 +00:00
|
|
|
return {
|
|
|
|
nodeSelection: state.config.nodeSelection,
|
|
|
|
nodeToggle: state.config.nodeToggle,
|
|
|
|
languageSelection: state.config.languageSelection,
|
2017-07-20 17:06:10 +00:00
|
|
|
languageToggle: state.config.languageToggle,
|
|
|
|
|
|
|
|
gasPriceGwei: state.config.gasPriceGwei
|
2017-07-04 03:21:19 +00:00
|
|
|
};
|
2017-04-12 05:04:27 +00:00
|
|
|
}
|
|
|
|
|
2017-07-04 01:25:01 +00:00
|
|
|
export default connect(mapStateToProps, actions)(App);
|