/
githubmirror
/
github-readme-stats
Обзор
Документация
Войти
/
githubmirror
/
github-readme-stats
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.1.6
src/common/createProgressNode.js
28 строк
653 B
Anurag Hazra
refactor: refactored createProgressNode logic (#486)
24 сен 2020, 10:50
Не верифицирован
24 сен 2020, 10:50
278d6a1
Код
Авторство
О чём код?
const { clampValue } = require("../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> `; }; exports.createProgressNode = createProgressNode;