Skip to content

Commit 582b0c8

Browse files
committed
Fill in sensed checkboxes
1 parent c4d0a02 commit 582b0c8

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/components/preview/ChecklistRenderer.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,20 @@ function actionLines(item: ActionItem): string[] {
101101

102102
/* ─── SVG primitives ─────────────────────────────────────────── */
103103

104-
function Tick({ x, y }: { x: number; y: number }) {
105-
return <rect x={x} y={y} width={22} height={22} fill="none" stroke={C_WHITE} strokeWidth={1.5} rx={2} />;
104+
function Tick({ x, y, sensed = false }: { x: number; y: number; sensed?: boolean }) {
105+
const s = 28;
106+
return (
107+
<rect
108+
x={x}
109+
y={y}
110+
width={s}
111+
height={s}
112+
fill={sensed ? "grey" : "black"}
113+
stroke="#848484"
114+
strokeWidth={2}
115+
strokeLinejoin="round"
116+
/>
117+
);
106118
}
107119

108120
function T({
@@ -119,7 +131,7 @@ function T({
119131
children: string;
120132
}) {
121133
return (
122-
<text x={x} y={y} fontFamily={FONT} fontSize={FS} textAnchor={anchor} fill={fill} style={{ whiteSpace: "pre" }}>
134+
<text x={x} y={y} fontSize={FS} textAnchor={anchor} fill={fill} style={{ whiteSpace: "pre", fontFamily: FONT }}>
123135
{children}
124136
</text>
125137
);
@@ -131,7 +143,7 @@ function ActionRow({ item, baseY }: { item: ActionItem; baseY: number }) {
131143
const lines = actionLines(item);
132144
return (
133145
<g>
134-
<Tick x={12} y={baseY + 9} />
146+
<Tick x={12} y={baseY + 9} sensed={item.sensed !== undefined} />
135147
{lines.map((line, i) => (
136148
<T key={i} x={49} y={baseY + 33 + HEIGHT_PER_ROW * i}>
137149
{line}

0 commit comments

Comments
 (0)