You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
623 B
JavaScript
19 lines
623 B
JavaScript
"use strict";
|
|
|
|
const React = require("react");
|
|
|
|
const useTheme = require("../../util/themeable");
|
|
const defaultStyle = require("./style.css");
|
|
const generateGridItemStyle = require("../../util/generate-grid-item-style");
|
|
|
|
module.exports = function ProgressBar({ x, y, progress, color }) {
|
|
// FIXME: Make color a theme thing
|
|
let { withTheme } = useTheme({ control: "progressBar", defaultStyle });
|
|
|
|
return (
|
|
<div className={withTheme("uilibComponent", "bar")} style={generateGridItemStyle({ x, y })}>
|
|
<div className={withTheme("fill")} style={{width: `${progress * 100}%`, backgroundColor: color}} />
|
|
</div>
|
|
);
|
|
};
|