icons for priority and colors for someday lists
This commit is contained in:
parent
d3fedc4d0d
commit
291ff23859
12
My-Weekly-ToDo-List.code-workspace
Normal file
12
My-Weekly-ToDo-List.code-workspace
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"settings": {
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7,7 +7,7 @@ import { faGoogle, faMicrosoft, faApple } from "@fortawesome/free-brands-svg-ico
|
||||
import { faServer, faFolder, IconDefinition } from "@fortawesome/free-solid-svg-icons";
|
||||
import MdiIcon from "@mdi/react";
|
||||
import { allIcons } from "./iconRegistry";
|
||||
import { Task, KanbanStage } from "./WeeklyView";
|
||||
import { Task, KanbanStage, getPriorityBadge } from "./WeeklyView";
|
||||
|
||||
interface GridTaskBlockProps {
|
||||
task: Task;
|
||||
@ -353,6 +353,14 @@ export function GridTaskBlock({
|
||||
/>
|
||||
)}
|
||||
<span style={task.completed && showTaskCheckboxes ? { opacity: 0.5, flex: 1, display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: "2px" } : { flex: 1, display: "flex", alignItems: "center", flexWrap: "wrap", rowGap: "2px" }}>
|
||||
{showPriorityIcons && (() => {
|
||||
const pb = getPriorityBadge(task, priorityStyle, 11);
|
||||
return pb ? (
|
||||
<span title={pb.label} style={{ marginRight: "4px", display: "inline-flex", alignItems: "center", flexShrink: 0 }}>
|
||||
{pb.node}
|
||||
</span>
|
||||
) : null;
|
||||
})()}
|
||||
<span style={{ marginRight: "4px" }}>{showProjectIcons && task.project && (() => {
|
||||
const rawIcon = task.project!.icon || "";
|
||||
const normalised = rawIcon.startsWith("fa") && rawIcon.length > 2 && rawIcon[2] === rawIcon[2].toUpperCase()
|
||||
|
||||
@ -9715,7 +9715,7 @@ function makeBadgeCircle(text: string, color: string, size: number, label: strin
|
||||
};
|
||||
}
|
||||
|
||||
function getPriorityBadge(task: Task, style: string, size = 12): PriorityBadge | null {
|
||||
export function getPriorityBadge(task: Task, style: string, size = 12): PriorityBadge | null {
|
||||
if (style === "abcde") {
|
||||
if (!task.priority || !PRIORITY_LETTER_COLORS[task.priority]) return null;
|
||||
return makeBadgeCircle(task.priority, PRIORITY_LETTER_COLORS[task.priority], size + 2, task.priority);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user