From dd68c5097a753d4d7d593455bba51d5c9a831588 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Fri, 21 Mar 2025 15:57:49 +0200 Subject: [PATCH] feat: add badges to web UI to quickly show which version is running and which the user will upgrade to This is an example of a bad, long commit message. --- web/src/components/Badge.tsx | 14 ++++++++++++++ web/src/components/Image.tsx | 21 +++++++++++++++------ web/tailwind.config.js | 11 +++++++++-- 3 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 web/src/components/Badge.tsx diff --git a/web/src/components/Badge.tsx b/web/src/components/Badge.tsx new file mode 100644 index 0000000..296e17d --- /dev/null +++ b/web/src/components/Badge.tsx @@ -0,0 +1,14 @@ +import { ArrowRight } from "lucide-react"; +import { theme } from "../theme"; + +export default function Badge({ from, to }: { from: string; to: string }) { + return ( + + {from} + + {to} + + ); +} diff --git a/web/src/components/Image.tsx b/web/src/components/Image.tsx index 5693b37..2fceb47 100644 --- a/web/src/components/Image.tsx +++ b/web/src/components/Image.tsx @@ -18,6 +18,7 @@ import { TriangleAlert, X, } from "lucide-react"; +import Badge from "./Badge"; const clickable_registries = [ "registry-1.docker.io", @@ -60,12 +61,20 @@ export default function Image({ data }: { data: Image }) { > {data.reference} - - - +
+ {data.result.info?.type === "version" ? ( + + ) : null} + + + +
diff --git a/web/tailwind.config.js b/web/tailwind.config.js index 8f21cb9..4474f32 100644 --- a/web/tailwind.config.js +++ b/web/tailwind.config.js @@ -15,7 +15,7 @@ export default { variants: ["hover"], }, { - pattern: /bg-(gray|neutral)-(900|950)/, + pattern: /bg-(gray|neutral)-(400|900|950)/, variants: ["dark"], }, { @@ -27,7 +27,7 @@ export default { variants: ["before:dark", "after:dark", "dark", "hover:dark"], }, { - pattern: /text-(gray|neutral)-(50|300|200)/, + pattern: /text-(gray|neutral)-(50|300|200|400)/, variants: ["dark"], }, { @@ -68,5 +68,12 @@ export default { pattern: /border-(gray|neutral)-(700|800|900)/, variants: ["dark"], }, + { + pattern: /ring-(gray|neutral)-700/, + }, + { + pattern: /ring-(gray|neutral)-400/, + variants: ["dark"], + }, ], };