mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Port navigation.
This commit is contained in:
@@ -2,11 +2,17 @@ import { useState } from "preact/hooks";
|
||||
|
||||
const counts: { [key: string]: number } = {};
|
||||
|
||||
export default function PaintCounter() {
|
||||
export default function PaintCounter({ small }: { small?: boolean }) {
|
||||
if (import.meta.env.PROD) return null;
|
||||
|
||||
const [uniqueId] = useState('' + Math.random());
|
||||
const count = counts[uniqueId] ?? 0;
|
||||
counts[uniqueId] = count + 1;
|
||||
return (
|
||||
<span>Painted {count + 1} time(s).</span>
|
||||
<span>
|
||||
{ small ? <>P: { count + 1 }</> : <>
|
||||
Painted {count + 1} time(s).
|
||||
</> }
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user