* GRS-1955: Using ES6 import/export in src files * GRS-1955: Using ES6 import/export in test files * GRS-1955: Using ES6 import/export in themes index.js * GRS-1955: Readding blank line at end of top-languages-card.js * feat: fix test es6 import errors This commit makes sure jest is set-up to support es6. It also fixes several test errors and sorts the imports. * test: update test node version This commit makes sure node 16 is used in the github actions. * refactor: run prettier Co-authored-by: rickstaa <rick.staa@outlook.com>
30 lines
664 B
JavaScript
30 lines
664 B
JavaScript
import { clampValue } from "../common/utils";
|
|
|
|
const createProgressNode = ({
|
|
x,
|
|
y,
|
|
width,
|
|
color,
|
|
progress,
|
|
progressBarBackgroundColor,
|
|
}) => {
|
|
const progressPercentage = clampValue(progress, 2, 100);
|
|
|
|
return `
|
|
<svg width="${width}" x="${x}" y="${y}">
|
|
<rect rx="5" ry="5" x="0" y="0" width="${width}" height="8" fill="${progressBarBackgroundColor}"></rect>
|
|
<rect
|
|
height="8"
|
|
fill="${color}"
|
|
rx="5" ry="5" x="0" y="0"
|
|
data-testid="lang-progress"
|
|
width="${progressPercentage}%"
|
|
>
|
|
</rect>
|
|
</svg>
|
|
`;
|
|
};
|
|
|
|
export { createProgressNode };
|
|
export default createProgressNode;
|