diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-05-25 19:54:38 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-05-25 19:54:38 +0200 |
| commit | 5a4de48a6d63cb383832f6ef85b21699a511b755 (patch) | |
| tree | 4c4fd18d26f8b5c95a6788d138ed62869357c975 /app/client/dashboard/dashboardHeader.component.js | |
| parent | 1a99af129427275c22e8276e75fa4b8da6602129 (diff) | |
stubbing in a lot of stuff!
Diffstat (limited to 'app/client/dashboard/dashboardHeader.component.js')
| -rw-r--r-- | app/client/dashboard/dashboardHeader.component.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/client/dashboard/dashboardHeader.component.js b/app/client/dashboard/dashboardHeader.component.js new file mode 100644 index 0000000..492dfd8 --- /dev/null +++ b/app/client/dashboard/dashboardHeader.component.js @@ -0,0 +1,39 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' +import { bindActionCreators } from 'redux' +import * as liveActions from '../live/actions' + +import * as util from '../util' + +class DashboardHeader extends Component { + constructor(props){ + super(props) + this.handleClick = this.handleClick.bind(this) + } + handleClick(e){ + this.props.onClick && this.props.onClick() + } + render() { + const { currentTask, site } = this.props + const eta = ((currentTask.epochs - currentTask.epoch) * 180 / 60) + " minutes" + return ( + <div class='dashboardHeader heading'> + <h3>{site.name}</h3> + Currently {util.gerund(currentTask.activity)} {currentTask.library} on {currentTask.dataset}<br/> + Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}<br/> + <br/> + Want to play live? <button>Pause at the end of this epoch</button> + </div> + ) + } +} + +const mapStateToProps = state => ({ + currentTask: state.system.currentTask, + site: state.system.site, +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(DashboardHeader) |
