Port and re-write icon code.

This commit is contained in:
Paul
2021-06-19 12:34:53 +01:00
parent ec97dbebd0
commit 5aa8f30e14
17 changed files with 412 additions and 41 deletions

12
src/lib/PaintCounter.tsx Normal file
View File

@@ -0,0 +1,12 @@
import { useState } from "preact/hooks";
const counts: { [key: string]: number } = {};
export default function PaintCounter() {
const [uniqueId] = useState('' + Math.random());
const count = counts[uniqueId] ?? 0;
counts[uniqueId] = count + 1;
return (
<span>Painted {count + 1} time(s).</span>
)
}