From 435794eb1bef41f54281bdd70afcd35ef3a25149 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Thu, 8 Jan 2026 23:16:07 +0100 Subject: [PATCH] remove LiveStatsMini --- frontend/src/ts/components/mount.tsx | 6 +-- frontend/src/ts/components/test/LiveStats.tsx | 50 ++++--------------- 2 files changed, 14 insertions(+), 42 deletions(-) diff --git a/frontend/src/ts/components/mount.tsx b/frontend/src/ts/components/mount.tsx index dd7271c1a..b083c8270 100644 --- a/frontend/src/ts/components/mount.tsx +++ b/frontend/src/ts/components/mount.tsx @@ -1,15 +1,15 @@ import { render } from "solid-js/web"; import { qsr } from "../utils/dom"; -import { LiveStats, LiveStatsMini } from "./test/LiveStats"; +import { LiveStats } from "./test/LiveStats"; import { getAcc, getBurst, getWpm } from "../signals/test"; export function mountComponents(): void { render( - () => , + () => , qsr("#liveStatsMini").native, ); render( - () => , + () => , qsr("#liveStatsTextBottom").native, ); } diff --git a/frontend/src/ts/components/test/LiveStats.tsx b/frontend/src/ts/components/test/LiveStats.tsx index 6d97f472e..82d18384c 100644 --- a/frontend/src/ts/components/test/LiveStats.tsx +++ b/frontend/src/ts/components/test/LiveStats.tsx @@ -1,4 +1,4 @@ -import { Accessor, createSignal, JSXElement } from "solid-js"; +import { Accessor, JSXElement } from "solid-js"; import { getLiveAccStyle, getLiveBurstStyle, @@ -37,61 +37,33 @@ const getStatsVisible = ( }); }; -export function LiveStatsMini(props: { +export function LiveStats(props: { + mode: "mini" | "text"; wpm: Accessor; acc: Accessor; burst: Accessor; }): JSXElement { + const isVisible = ( + config: Accessor, + ): Accessor => + getStatsVisible(() => config() === props.mode); + return ( <> getLiveSpeedStyle() === "mini", - )} + visibilityOptions={isVisible(getLiveSpeedStyle)} /> getLiveAccStyle() === "mini")} + visibilityOptions={isVisible(getLiveAccStyle)} /> getLiveBurstStyle() === "mini", - )} - /> - - ); -} - -export function LiveStats(props: { - wpm: Accessor; - acc: Accessor; - burst: Accessor; -}): JSXElement { - return ( - <> - getLiveSpeedStyle() === "text", - )} - /> - getLiveAccStyle() === "text")} - /> - getLiveBurstStyle() === "text", - )} + visibilityOptions={isVisible(getLiveBurstStyle)} /> );