Fix progress bar color when checking files
This commit is contained in:
parent
51ed57a74d
commit
0ff63d8a24
3 changed files with 21 additions and 18 deletions
20
crates/librqbit/webui/dist/assets/index.js
vendored
20
crates/librqbit/webui/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
2
crates/librqbit/webui/dist/manifest.json
vendored
2
crates/librqbit/webui/dist/manifest.json
vendored
|
|
@ -11,7 +11,7 @@
|
|||
"css": [
|
||||
"assets/index-d46108e9.css"
|
||||
],
|
||||
"file": "assets/index-e6c23bc1.js",
|
||||
"file": "assets/index-b218d1f9.js",
|
||||
"isEntry": true,
|
||||
"src": "index.html"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,20 +4,23 @@ type Props = {
|
|||
variant?: "warn" | "info" | "success" | "error";
|
||||
};
|
||||
|
||||
const variantClassNames = {
|
||||
warn: "bg-amber-500 text-white",
|
||||
info: "bg-blue-500 text-white",
|
||||
success: "bg-green-700 text-white",
|
||||
error: "bg-red-500 text-white",
|
||||
};
|
||||
|
||||
export const ProgressBar = ({ now, variant, label }: Props) => {
|
||||
const progressLabel = label ?? `${now.toFixed(2)}%`;
|
||||
|
||||
const variantClassName = {
|
||||
warn: "bg-amber-500",
|
||||
info: "bg-blue-500 text-white",
|
||||
success: "bg-green-700 text-white",
|
||||
error: "bg-red-500 text-white",
|
||||
}[variant ?? "info"];
|
||||
const variantClassName =
|
||||
variantClassNames[variant ?? "info"] ?? variantClassNames["info"];
|
||||
|
||||
return (
|
||||
<div className={"w-full bg-gray-200 rounded-full dark:bg-gray-500"}>
|
||||
<div
|
||||
className={`text-xs bg-blue-500 text-white font-medium transition-all text-center p-0.5 leading-none rounded-full ${variantClassName}`}
|
||||
className={`text-xs font-medium transition-all text-center p-0.5 leading-none rounded-full ${variantClassName}`}
|
||||
style={{ width: `${now}%` }}
|
||||
>
|
||||
{progressLabel}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue