You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-wallet/src/js/components/wallet/index.js

57 lines
1.7 KiB

/* @flow */
import * as React from 'react';
import { connect } from 'react-redux';
import { Route, withRouter } from 'react-router-dom';
import Header from '../common/Header';
import Footer from '../common/Footer';
import AccountTabs from './account/AccountTabs';
import DeviceSettingsTabs from './pages/DeviceSettingsTabs';
import AsideContainer from './aside';
import ModalContainer from '../modal';
import Notifications from '../common/Notification';
import Log from '../common/Log';
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from 'flowtype';
type WalletContainerProps = {
wallet: $ElementType<State, 'wallet'>,
children?: React.Node
}
type ContentProps = {
children?: React.Node
}
const Wallet = (props: WalletContainerProps) => (
<div className="app">
<Header />
{/* <div>{ props.wallet.online ? "ONLINE" : "OFFLINE" }</div> */}
<main>
<AsideContainer />
<article>
<nav>
<Route path="/device/:device/network/:network/account/:account" component={AccountTabs} />
<Route path="/device/:device/device-settings" component={DeviceSettingsTabs} />
</nav>
<Notifications />
<Log />
{ props.children }
<Footer />
</article>
</main>
<ModalContainer />
</div>
);
const mapStateToProps: MapStateToProps<State, {}, WalletContainerProps> = (state: State, own: {}): WalletContainerProps => ({
wallet: state.wallet,
});
export default withRouter(
connect(mapStateToProps, null)(Wallet),
);