diff --git a/src/backend/components/boardgame.tsx b/src/backend/components/boardgame.tsx index 883c760..c90d4ad 100644 --- a/src/backend/components/boardgame.tsx +++ b/src/backend/components/boardgame.tsx @@ -52,7 +52,7 @@ export const getBoardgameHtml = (key: string, gameState: BoardgameStateType, gam .map(([name]) => name); return ( - +

diff --git a/src/backend/components/counter.tsx b/src/backend/components/counter.tsx index 2664bad..ded2da7 100644 --- a/src/backend/components/counter.tsx +++ b/src/backend/components/counter.tsx @@ -6,15 +6,15 @@ export const getCounterHtml = (req: Request, key: string) => { return ( <> - {" "} -

{" "} Value of "{key}":{" "} - + {counter} diff --git a/src/frontend/components/reactive-button.ts b/src/frontend/components/reactive-button.ts index 87acbcc..dd2f12d 100644 --- a/src/frontend/components/reactive-button.ts +++ b/src/frontend/components/reactive-button.ts @@ -4,7 +4,7 @@ class ReactiveButton extends HTMLButtonElement { private readonly trackingTools = new TrackingTools(this); handleTrackedValueUpdate(newValue: string | null) { - const delta = parseInt(this.getAttribute("delta") ?? "0", 10); + const delta = parseInt(this.getAttribute("data-delta") ?? "0", 10); this.value = (parseInt(newValue ?? "0", 10) + delta).toString(); } diff --git a/src/frontend/utils/query-tracking-utils.ts b/src/frontend/utils/query-tracking-utils.ts index 6674b50..05eeb27 100644 --- a/src/frontend/utils/query-tracking-utils.ts +++ b/src/frontend/utils/query-tracking-utils.ts @@ -27,7 +27,7 @@ export class TrackingTools< constructor(private readonly element: TElement) {} private setTrackerIfNeeded() { - const trackKey = this.element.getAttribute("track"); + const trackKey = this.element.getAttribute("data-track"); if (trackKey != this.currentTrackKey) { if (this.clearTracker) { this.clearTracker(); diff --git a/src/jsx-augmentations.ts b/src/jsx-augmentations.ts index c006981..8b8c337 100644 --- a/src/jsx-augmentations.ts +++ b/src/jsx-augmentations.ts @@ -1,13 +1,6 @@ declare module "preact/jsx-runtime" { // eslint-disable-next-line @typescript-eslint/no-namespace -- preact uses namespaces, so we have too namespace JSX { - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- this is how declaration merging is done - interface HTMLAttributes { - // custom attribute used by query-tracker web components - delta?: string; - track?: string; - } - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- this is how declaration merging is done interface IntrinsicElements { "board-game": HTMLAttributes;