Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(web): color priority marks by level

Tin9293522d7f35
diff --git a/apps/web/src/components/task-chips/priority-glyph.tsx b/apps/web/src/components/task-chips/priority-glyph.tsx
index 3b73d6dd5..7ec8cd661 100644
--- a/apps/web/src/components/task-chips/priority-glyph.tsx
+++ b/apps/web/src/components/task-chips/priority-glyph.tsx
@@ -2,11 +2,11 @@ import { cn } from "@/lib/cn";
const MARKS = [3, 7, 11];
-const FILLED: Record<string, number> = {
- low: 1,
- medium: 2,
- high: 3,
- urgent: 3,
+const LEVELS: Record<string, { filled: number; tone: string }> = {
+ low: { filled: 1, tone: "fill-priority-low stroke-priority-low" },
+ medium: { filled: 2, tone: "fill-priority-medium stroke-priority-medium" },
+ high: { filled: 3, tone: "fill-priority-high stroke-priority-high" },
+ urgent: { filled: 3, tone: "fill-priority-urgent stroke-priority-urgent" },
};
type PriorityGlyphProps = {
@@ -15,8 +15,7 @@ type PriorityGlyphProps = {
};
export function PriorityGlyph({ priority, className }: PriorityGlyphProps) {
- const filled = FILLED[priority ?? ""] ?? 0;
- const urgent = priority === "urgent";
+ const { filled, tone } = LEVELS[priority ?? ""] ?? { filled: 0, tone: "" };
return (
<svg
@@ -24,25 +23,24 @@ export function PriorityGlyph({ priority, className }: PriorityGlyphProps) {
aria-hidden="true"
className={cn("size-3.5 shrink-0", className)}
>
- {MARKS.map((x, index) => {
- const tone =
- index >= filled
- ? "fill-priority-bar-empty stroke-priority-bar-empty"
- : urgent
- ? "fill-priority-urgent stroke-priority-urgent"
- : "fill-priority-bar stroke-priority-bar";
- return (
- <g key={x} className={tone}>
- <path
- d={`M${x} 2.5v5.5`}
- fill="none"
- strokeWidth="1.7"
- strokeLinecap="round"
- />
- <circle cx={x} cy="11" r="1" stroke="none" />
- </g>
- );
- })}
+ {MARKS.map((x, index) => (
+ <g
+ key={x}
+ className={
+ index < filled
+ ? tone
+ : "fill-priority-bar-empty stroke-priority-bar-empty"
+ }
+ >
+ <path
+ d={`M${x} 2.5v5.5`}
+ fill="none"
+ strokeWidth="1.7"
+ strokeLinecap="round"
+ />
+ <circle cx={x} cy="11" r="1" stroke="none" />
+ </g>
+ ))}
</svg>
);
}
diff --git a/apps/web/src/index.css b/apps/web/src/index.css
index 451d15c65..2825f1a99 100644
--- a/apps/web/src/index.css
+++ b/apps/web/src/index.css
@@ -134,6 +134,9 @@ input:-webkit-autofill:active {
--color-chip-icon: var(--chip-icon);
--color-priority-bar: var(--priority-bar);
--color-priority-bar-empty: var(--priority-bar-empty);
+ --color-priority-low: var(--priority-low);
+ --color-priority-medium: var(--priority-medium);
+ --color-priority-high: var(--priority-high);
--color-priority-urgent: var(--priority-urgent);
--color-due-overdue: var(--due-overdue);
--color-avatar: var(--avatar);
@@ -259,6 +262,9 @@ input:-webkit-autofill:active {
--chip-icon: #8a8a8a;
--priority-bar: #525252;
--priority-bar-empty: #00000021;
+ --priority-low: #2563eb;
+ --priority-medium: #d97706;
+ --priority-high: #ea580c;
--priority-urgent: #dc2626;
--due-overdue: #dc2626;
--avatar: #e5e5e5;
@@ -350,6 +356,9 @@ input:-webkit-autofill:active {
--chip-icon: #8a8a8a;
--priority-bar: #a3a3a3;
--priority-bar-empty: #ffffff24;
+ --priority-low: #60a5fa;
+ --priority-medium: #fbbf24;
+ --priority-high: #fb923c;
--priority-urgent: #e5484d;
--due-overdue: #ff6467;
--avatar: #2e2e2e;