forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dashboard: integrate Flow, sketch message API (ethereum#15713)
* dashboard: minor design change * dashboard: Flow integration, message API * dashboard: minor polishes, exclude misspell linter
- Loading branch information
Showing
23 changed files
with
49,960 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[ignore] | ||
<PROJECT_ROOT>/node_modules/material-ui/.*\.js\.flow | ||
|
||
[libs] | ||
<PROJECT_ROOT>/flow-typed/ | ||
node_modules/jss/flow-typed | ||
|
||
[options] | ||
include_warnings=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// @flow | ||
|
||
// 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'; | ||
|
||
import withStyles from 'material-ui/styles/withStyles'; | ||
|
||
import SideBar from './SideBar'; | ||
import Main from './Main'; | ||
import type {Content} from '../types/content'; | ||
|
||
// Styles for the Body component. | ||
const styles = () => ({ | ||
body: { | ||
display: 'flex', | ||
width: '100%', | ||
height: '100%', | ||
}, | ||
}); | ||
export type Props = { | ||
classes: Object, | ||
opened: boolean, | ||
changeContent: () => {}, | ||
active: string, | ||
content: Content, | ||
shouldUpdate: Object, | ||
}; | ||
// Body renders the body of the dashboard. | ||
class Body extends Component<Props> { | ||
render() { | ||
const {classes} = this.props; // The classes property is injected by withStyles(). | ||
|
||
return ( | ||
<div className={classes.body}> | ||
<SideBar | ||
opened={this.props.opened} | ||
changeContent={this.props.changeContent} | ||
/> | ||
<Main | ||
active={this.props.active} | ||
content={this.props.content} | ||
shouldUpdate={this.props.shouldUpdate} | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default withStyles(styles)(Body); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @flow | ||
|
||
// 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'; | ||
import type {Node} from 'react'; | ||
|
||
import Grid from 'material-ui/Grid'; | ||
import {ResponsiveContainer} from 'recharts'; | ||
|
||
export type Props = { | ||
spacing: number, | ||
children: Node, | ||
}; | ||
// ChartGrid renders a grid container for responsive charts. | ||
// The children are Recharts components extended with the Material-UI's xs property. | ||
class ChartGrid extends Component<Props> { | ||
render() { | ||
return ( | ||
<Grid container spacing={this.props.spacing}> | ||
{ | ||
React.Children.map(this.props.children, child => ( | ||
<Grid item xs={child.props.xs}> | ||
<ResponsiveContainer width="100%" height={child.props.height}> | ||
{React.cloneElement(child, {data: child.props.values.map(value => ({value}))})} | ||
</ResponsiveContainer> | ||
</Grid> | ||
)) | ||
} | ||
</Grid> | ||
); | ||
} | ||
} | ||
|
||
export default ChartGrid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.