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": [
|
"css": [
|
||||||
"assets/index-d46108e9.css"
|
"assets/index-d46108e9.css"
|
||||||
],
|
],
|
||||||
"file": "assets/index-e6c23bc1.js",
|
"file": "assets/index-b218d1f9.js",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "index.html"
|
"src": "index.html"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,20 +4,23 @@ type Props = {
|
||||||
variant?: "warn" | "info" | "success" | "error";
|
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) => {
|
export const ProgressBar = ({ now, variant, label }: Props) => {
|
||||||
const progressLabel = label ?? `${now.toFixed(2)}%`;
|
const progressLabel = label ?? `${now.toFixed(2)}%`;
|
||||||
|
|
||||||
const variantClassName = {
|
const variantClassName =
|
||||||
warn: "bg-amber-500",
|
variantClassNames[variant ?? "info"] ?? variantClassNames["info"];
|
||||||
info: "bg-blue-500 text-white",
|
|
||||||
success: "bg-green-700 text-white",
|
|
||||||
error: "bg-red-500 text-white",
|
|
||||||
}[variant ?? "info"];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"w-full bg-gray-200 rounded-full dark:bg-gray-500"}>
|
<div className={"w-full bg-gray-200 rounded-full dark:bg-gray-500"}>
|
||||||
<div
|
<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}%` }}
|
style={{ width: `${now}%` }}
|
||||||
>
|
>
|
||||||
{progressLabel}
|
{progressLabel}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue