Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix: [XEOS-6821] update usage-bar component minWidth style
Browse files Browse the repository at this point in the history
Signed-off-by: qianwen@xsky.com <qianwen@xsky.com>
  • Loading branch information
qianwen@xsky.com committed Dec 16, 2022
1 parent 369853f commit 9eb90b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/UsageBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ const UsageBar: React.FC<UsageBarProps> = props => {
{
lodash.map(finalSeries, ({ bsStyle, perc }, index) => (
// bs ProgressBar 只支持最多 5 种 style,索引摒弃 bsStyle 属性,改用组装 className
// style用于展示最小进度,不满1px时以1px展示,考虑以百分比展示时的最小展示进度,只要perc >= 0.00005,都会展示为0.01%,应展示最小进度;但如果展示的是0.00%,实际上是有很小的值,但从体验层面上,应该不展示进度,故需要对临界点做处理
// style用于展示最小进度,不满1px时以1px展示,只要perc > 0,最小进度就是1px
<ProgressBar className={bsStyle && `progress-bar-${bsStyle}`} now={perc} max={1} key={index}
style={{ 'minWidth': (!hasPercent && !isPercent && perc > 0) ? '1px' : isPercent && perc >= 0.00005 ? '1px' : '0px' }} />
style={{ 'minWidth': perc > 0 ? '1px': '0px' }} />
))
}
</ProgressBar>
Expand Down

0 comments on commit 9eb90b5

Please sign in to comment.