ui/StatsPage.tsx aktualisiert

Make the counters update faster to make it look more snappy.
This commit is contained in:
Akiru 2024-01-25 08:53:35 +00:00
parent 85bd9b5861
commit 128c4312d4
1 changed files with 10 additions and 10 deletions

View File

@ -7,7 +7,7 @@ export function StatsPage() {
const getGlobalStats = useSWR(
["/stats", {}] as const,
(args) => fetchApi(...args).then(handleResponse),
{ refreshInterval: 2_000 },
{ refreshInterval: 1_00 },
);
return (
@ -18,13 +18,13 @@ export function StatsPage() {
className="font-bold text-zinc-700 dark:text-zinc-300"
value={getGlobalStats.data?.pixelStepCount ?? 0}
digits={15}
transitionDurationMs={3_000}
transitionDurationMs={1_00}
/>
<Counter
className="text-base"
value={(getGlobalStats.data?.pixelStepsPerMinute ?? 0) / 60}
digits={9}
transitionDurationMs={2_000}
transitionDurationMs={1_00}
postfix="/s"
/>
</p>
@ -34,13 +34,13 @@ export function StatsPage() {
className="font-bold text-zinc-700 dark:text-zinc-300"
value={getGlobalStats.data?.pixelCount ?? 0}
digits={15}
transitionDurationMs={3_000}
transitionDurationMs={1_00}
/>
<Counter
className="text-base"
value={(getGlobalStats.data?.pixelsPerMinute ?? 0) / 60}
digits={9}
transitionDurationMs={2_000}
transitionDurationMs={1_00}
postfix="/s"
/>
</p>
@ -51,14 +51,14 @@ export function StatsPage() {
className="font-bold text-zinc-700 dark:text-zinc-300"
value={getGlobalStats.data?.stepCount ?? 0}
digits={9}
transitionDurationMs={3_000}
transitionDurationMs={1_00}
/>
<Counter
className="text-base"
value={(getGlobalStats.data?.stepsPerMinute ?? 0) / 60}
digits={3}
fractionDigits={3}
transitionDurationMs={2_000}
transitionDurationMs={1_00}
postfix="/s"
/>
</p>
@ -68,14 +68,14 @@ export function StatsPage() {
className="font-bold text-zinc-700 dark:text-zinc-300"
value={getGlobalStats.data?.imageCount ?? 0}
digits={9}
transitionDurationMs={3_000}
transitionDurationMs={1_00}
/>
<Counter
className="text-base"
value={(getGlobalStats.data?.imagesPerMinute ?? 0) / 60}
digits={3}
fractionDigits={3}
transitionDurationMs={2_000}
transitionDurationMs={1_00}
postfix="/s"
/>
</p>
@ -86,7 +86,7 @@ export function StatsPage() {
className="font-bold text-zinc-700 dark:text-zinc-300"
value={getGlobalStats.data?.userCount ?? 0}
digits={6}
transitionDurationMs={1_500}
transitionDurationMs={1_00}
/>
</p>
</div>