William O'Beirne aa0f9cd455 Electron Redesign (#1505)
* Frameless Electron. Separate electron template. Generecize navigation link. Move nav info to config.

* Add controls for language and node, network status to sidebar.

* Sticky headers

* Move custom node modal into standalone component. Render modals via portal. Add custom node modal opening to electron node list.

* Conditional styling based on environment.

* Fix active node highlight

* Add frame back in, draggable only on OSX, fix sidebar scroll.

* Remove panel content after delay.

* Adjust window sizes

* Style desktop help nav icon

* Remove unused var

* Move style to param

* Remove unused

* Update snapshot

* Fix oversized stretching, zindex fighting

* Make electron work better with various screen sizes

* Remove not-working https option for electron

* Add beta banner

* Fix web footer

* Address changes
2018-04-16 18:30:58 -05:00

55 lines
1.6 KiB
TypeScript

import React, { Component } from 'react';
import { connect } from 'react-redux';
import { BetaAgreement, Footer, Header } from 'components';
import { AppState } from 'reducers';
import Notifications from './Notifications';
import OfflineTab from './OfflineTab';
import { getOffline, getLatestBlock } from 'selectors/config';
import { Query } from 'components/renderCbs';
import './WebTemplate.scss';
interface StateProps {
isOffline: AppState['config']['meta']['offline'];
latestBlock: AppState['config']['meta']['latestBlock'];
}
interface OwnProps {
isUnavailableOffline?: boolean;
children: string | React.ReactElement<string> | React.ReactElement<string>[];
}
type Props = OwnProps & StateProps;
class WebTemplate extends Component<Props, {}> {
public render() {
const { isUnavailableOffline, children, isOffline, latestBlock } = this.props;
return (
<div className="WebTemplate">
<Query
params={['network']}
withQuery={({ network }) => (
<Header networkParam={network && `${network.toLowerCase()}_auto`} />
)}
/>
<div className="Tab container">
{isUnavailableOffline && isOffline ? <OfflineTab /> : children}
</div>
<div className="WebTemplate-spacer" />
<Footer latestBlock={latestBlock} />
<Notifications />
<BetaAgreement />
</div>
);
}
}
function mapStateToProps(state: AppState): StateProps {
return {
isOffline: getOffline(state),
latestBlock: getLatestBlock(state)
};
}
export default connect(mapStateToProps, {})(WebTemplate);