2017-12-21 18:54:38 +03:00
|
|
|
// @flow
|
|
|
|
|
2017-11-14 20:34:00 +03:00
|
|
|
// Copyright 2017 The go-ethereum Authors
|
|
|
|
// This file is part of the go-ethereum library.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
import React, {Component} from 'react';
|
2017-12-21 18:54:38 +03:00
|
|
|
|
|
|
|
import withStyles from 'material-ui/styles/withStyles';
|
2017-11-14 20:34:00 +03:00
|
|
|
import AppBar from 'material-ui/AppBar';
|
|
|
|
import Toolbar from 'material-ui/Toolbar';
|
|
|
|
import IconButton from 'material-ui/IconButton';
|
2018-03-08 11:22:21 +03:00
|
|
|
import Icon from 'material-ui/Icon';
|
|
|
|
import MenuIcon from 'material-ui-icons/Menu';
|
2017-12-21 18:54:38 +03:00
|
|
|
import Typography from 'material-ui/Typography';
|
2018-01-23 23:51:04 +03:00
|
|
|
|
|
|
|
// themeStyles returns the styles generated from the theme for the component.
|
|
|
|
const themeStyles = (theme: Object) => ({
|
2017-12-21 18:54:38 +03:00
|
|
|
header: {
|
2018-03-08 11:22:21 +03:00
|
|
|
backgroundColor: theme.palette.grey[900],
|
|
|
|
color: theme.palette.getContrastText(theme.palette.grey[900]),
|
2017-12-21 18:54:38 +03:00
|
|
|
zIndex: theme.zIndex.appBar,
|
|
|
|
},
|
|
|
|
toolbar: {
|
|
|
|
paddingLeft: theme.spacing.unit,
|
|
|
|
paddingRight: theme.spacing.unit,
|
|
|
|
},
|
2018-01-23 23:51:04 +03:00
|
|
|
title: {
|
2017-12-21 18:54:38 +03:00
|
|
|
paddingLeft: theme.spacing.unit,
|
2018-03-08 11:22:21 +03:00
|
|
|
fontSize: 3 * theme.spacing.unit,
|
2017-12-21 18:54:38 +03:00
|
|
|
},
|
2017-11-14 20:34:00 +03:00
|
|
|
});
|
2018-01-23 23:51:04 +03:00
|
|
|
|
2017-12-21 18:54:38 +03:00
|
|
|
export type Props = {
|
2018-01-23 23:51:04 +03:00
|
|
|
classes: Object, // injected by withStyles()
|
|
|
|
switchSideBar: () => void,
|
2017-12-21 18:54:38 +03:00
|
|
|
};
|
2018-01-23 23:51:04 +03:00
|
|
|
|
2017-12-21 18:54:38 +03:00
|
|
|
// Header renders the header of the dashboard.
|
|
|
|
class Header extends Component<Props> {
|
|
|
|
render() {
|
2018-03-08 11:22:21 +03:00
|
|
|
const {classes} = this.props;
|
2017-12-21 18:54:38 +03:00
|
|
|
|
|
|
|
return (
|
2018-01-23 23:51:04 +03:00
|
|
|
<AppBar position='static' className={classes.header}>
|
2017-12-21 18:54:38 +03:00
|
|
|
<Toolbar className={classes.toolbar}>
|
2018-03-08 11:22:21 +03:00
|
|
|
<IconButton onClick={this.props.switchSideBar}>
|
|
|
|
<Icon>
|
|
|
|
<MenuIcon />
|
|
|
|
</Icon>
|
|
|
|
</IconButton>
|
2018-01-23 23:51:04 +03:00
|
|
|
<Typography type='title' color='inherit' noWrap className={classes.title}>
|
2017-12-21 18:54:38 +03:00
|
|
|
Go Ethereum Dashboard
|
|
|
|
</Typography>
|
|
|
|
</Toolbar>
|
|
|
|
</AppBar>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2017-11-14 20:34:00 +03:00
|
|
|
|
2018-01-23 23:51:04 +03:00
|
|
|
export default withStyles(themeStyles)(Header);
|