Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import { Progress } from "antd";
import styled from "styled-components";
import styled, { keyframes, css } from "styled-components";

export const StyledProgress = styled(Progress)`
.ant-progress-outer {
margin-right: 0px;
padding-right: 0px;
}
.ant-progress-text {
display: none;
}
const indeterminateAnimation = keyframes`
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(500%);
}
`;

export const StyledProgress = styled(Progress)<{ $isIndeterminate?: boolean }>`
.ant-progress-outer {
margin-right: 0px;
padding-right: 0px;
}
.ant-progress-text {
display: none;
}

${(props) =>
props.$isIndeterminate &&
css`
.ant-progress-bg {
width: 25% !important;
animation: ${indeterminateAnimation} 1.5s ease-in-out infinite;
}
`}
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { StyledProgress } from './ProgressBarValue.styles';
import React from "react";
import { StyledProgress } from "./ProgressBarValue.styles";

export const ProgressBarValue = ({ value }: { value?: number }) => {
const isIndeterminate = value === -1;
const textValue = `${(value || 0).toLocaleString("en-US", {
minimumIntegerDigits: 1,
maximumFractionDigits: 4,
Expand All @@ -10,8 +11,13 @@ export const ProgressBarValue = ({ value }: { value?: number }) => {

return (
<div style={{ flex: 1, display: "flex", alignItems: "center" }}>
<StyledProgress percent={value} />
<div style={{ flexGrow: 1, paddingLeft: 10 }}>{textValue}</div>
<StyledProgress
percent={isIndeterminate ? 50 : value}
$isIndeterminate={isIndeterminate}
/>
{!isIndeterminate && (
<div style={{ flexGrow: 1, paddingLeft: 10 }}>{textValue}</div>
)}
</div>
);
};
};