mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 01:23:52 +00:00
34 lines
898 B
TypeScript
34 lines
898 B
TypeScript
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2020 The Pybricks Authors
|
|
|
|
import { ProgressBar } from '@blueprintjs/core';
|
|
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { RootState } from '../reducers';
|
|
|
|
import './status-bar.scss';
|
|
|
|
type StateProps = { progress: number };
|
|
|
|
type StatusProps = StateProps;
|
|
|
|
class StatusBar extends React.Component<StatusProps> {
|
|
render(): JSX.Element {
|
|
return (
|
|
<div className="status-bar" onContextMenu={(e): void => e.preventDefault()}>
|
|
<ProgressBar
|
|
className="status-bar-item"
|
|
value={this.props.progress}
|
|
animate={false}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
const mapStateToProps = (state: RootState): StateProps => ({
|
|
progress: state.status.progress,
|
|
});
|
|
|
|
export default connect(mapStateToProps)(StatusBar);
|